Demo
07 SDK REFERENCE

SDK reference

AUTO-GENERATEDBUILD 2026.12.05

The Python SDK — use it to build TestZeus into your own apps, services, and automation.

Quick example

python
from testzeus_sdk import TestZeusClient

async with TestZeusClient() as client:
    tests = await client.tests.get_list()

Test Blocks (client.test_blocks)

Author step-based tests through the test-builder API. TestManager.create / update refuse Test Blocks records — use TestBlocksManager instead.

Requires testzeus-cli ≥ 0.0.32, testzeus-sdk ≥ 0.0.28, and testzeus-mcp-server ≥ 2.0.4 for the matching surfaces. Split review needs testzeus-cli ≥ 0.0.35 and testzeus-sdk ≥ 0.0.34.

Test Blocks product guide.

python
async with TestZeusClient() as client:
    tb = await client.test_blocks.create(
        "Checkout smoke",
        testing_type="web",  # or "mobile"
        environment="ENV_ID",
    )
    test_id = tb["id"]
    await client.test_blocks.update_config(test_id, environment_url_key="home")  # web only
    await client.test_blocks.add_step(test_id, instruction="Open the dashboard")
    try:
        await client.test_blocks.verify(test_id)
    except SplitReviewRequired as held:
        for step in held.held:  # step_id, label, reason, candidates
            await client.test_blocks.apply_split(test_id, step["step_id"])  # or dismiss_split
        await client.test_blocks.verify(test_id)
    await client.test_blocks.wait_for_verify(test_id)
    await client.test_blocks.save(test_id)
    run = await client.test_blocks.live_run(test_id, key="smoke-1")

Step types: browser, mobile, backend, soql, apex, http. Mobile tests should use mobile steps only in a given run range.

Before it runs anything, verify checks that each plain-language browser step is one action. A step that bundles several is held with suggested steps: apply the split (all suggestions, or the ones you pick), reword the step, or keep it as one on purpose, then verify again. Assertions, recorded steps, code you wrote, logic and backend steps are never held. SplitReviewRequired is importable from testzeus_sdk.managers.test_blocks_manager.

When a step fails verify, get(test_id) carries authoring_progress.failure on that step: headline says what went wrong and recommendation how to fix it. Then update_step and verify again; get_run_status(run_id) follows a live run.

TestZeusRequestError

A gateway request that returned a non-2xx status.

Subclasses ValueError so existing except ValueError callers keep working, while status and body let callers react to e.g. a 409 conflict payload. code and params are gateway-pb's error code and its values; branch on code, never on the message (see gateway-pb docs/error-codes.md).

TestZeusAuthError

The platform refused the credentials or the action (401/403).

TestZeusNotFoundError

The requested record or endpoint does not exist (404).

TestZeusValidationError

The platform rejected the request body or parameters (400/422).

TestZeusServerError

The platform failed (5xx) or could not be reached (connection error, timeout).

TestZeusClient

Client for interacting with TestZeus API.

TestZeusClient.download_file(collection: str, record_id: str, file_name: str, output_dir: str = "downloads", max_bytes: Optional[int] = None, timeout_seconds: Optional[int] = None)

Download one record file into output_dir and return its path.

The file keeps the base name of file_name (a number is added when that name is taken), cannot leave output_dir, is written to <name>.part and renamed only when complete, and is at most max_bytes. The file token never appears in an error. Raises ValueError for a bad name and TestZeusRequestError for a failed, oversized or timed-out download.

TestZeusClient.ensure_authenticated()

Ensure the client is authenticated before making API calls

TestZeusClient.authenticate(email: str, password: str)

Authenticate with email and password

Args: email: User email password: User password

Returns: Authentication token

TestZeusClient.request(method: str, endpoint: str, params: Optional[Dict[str, Any]] = None, json_data: Optional[Dict[str, Any]] = None, data: Optional[Any] = None)

Make an API request

Args: method: HTTP method (GET, POST, PATCH, DELETE) endpoint: API endpoint (starting with /) params: Query parameters json_data: JSON body for POST/PATCH requests data: Form data for POST requests

Returns: API response as dictionary

TestZeusClient.is_authenticated()

Check if the client is authenticated

Returns: True if authenticated

TestZeusClient.logout()

Logout and clear authentication state

TestZeusClient.get_tenant_id()

Get the current tenant ID

Returns: Tenant ID or default tenant ID if not authenticated

TestZeusClient.get_tenant_id_async()

Get the current tenant ID (async version)

TestZeusClient.get_user_id()

Get the current User ID

Returns: User ID or empty string if not authenticated or not implemented

TestZeusClient.get_user_id_async()

Get the current User ID (async version)

TestZeusClient.get_file_token()

Get the current file token

TestZeusClient.set_tenant_id(tenant_id: str)

Explicitly set the tenant ID to use for operations

Args: tenant_id: The tenant ID to use

AdversaryPathwaysGenerationManager

BaseManager-backed manager for adversary pathway generation jobs.

AdversaryPathwaysGenerationManager.create(data: Dict[str, Any])

Create a generation job.

This collection requires created_by in addition to the tenant + modified_by that BaseManager injects, so fill it from the session too.

AdversaryPathwaysGroupManager

BaseManager-backed manager for adversary simulation run groups.

AdversaryPathwaysGroupManager.create(data: Dict[str, Any])

Create a run group.

This collection requires created_by in addition to the tenant + modified_by that BaseManager injects, so fill it from the session too.

AdversaryPathwaysManager

BaseManager-backed manager for adversary pathway (test scenario) records.

AdversaryPathwaysManager.create(data: Dict[str, Any])

Create a pathway (tenant + modified_by auto-injected by BaseManager).

AdversarySimulationsManager

BaseManager-backed manager for adversary simulation records.

Simulations are created by the backend workflow when a run group is submitted, so this manager is read-oriented (get_list / get_one); the SDK never creates simulation records directly.

AgentConfigsManager

Manager for AgentConfigs resources

AgentHarnessManager

Facade for the Agent Harness (adversarial agent testing) subsystem.

AgentHarnessManager.list_agents(page: int = 1, per_page: int = 50, status: Optional[str] = None, search: Optional[str] = None, type: Optional[str] = None)

List available agents (custom gateway-pb endpoint).

AgentHarnessManager.get_agent(agent_id: str)

Get a single agent's detail (custom gateway-pb endpoint).

AgentHarnessManager.list_pathways(agent_id: Optional[str] = None, page: int = 1, per_page: int = 50)

List adversarial test pathways, optionally scoped to one agent.

Delegates to the sub-manager's get_list so the filter is built by the shared _build_filter_string (value-escaped) and items come back as AdversaryPathways model instances.

AgentHarnessManager.create_pathway(data: Dict[str, Any])

Create a custom adversarial pathway (tenant + modified_by auto-filled).

AgentHarnessManager.delete_pathway(pathway_id: str)

Soft-delete a pathway (PATCH is_deleted=True through BaseManager.update).

AgentHarnessManager.generate_pathways(agent_profile: str, directional_prompt: str, name: Optional[str] = None, agent_name: Optional[str] = None, num_pathways: Optional[int] = None, allow_destructive: bool = False, status: str = "pending")

Start an AI pathway-generation job for a Salesforce agent profile.

Creates an adversary_pathways_generation record via the sub-manager (is_submit=True triggers the workflow). tenant/created_by/modified_by are auto-filled from the authenticated session by the manager.

AgentHarnessManager.run(agent_id: str, pathway_ids: List[str], name: Optional[str] = None, agent_name: Optional[str] = None, run_as_profile: Optional[str] = None, status: str = "pending")

Start a simulation run (create an adversary_pathways_group record).

tenant/created_by/modified_by are auto-filled from the session by the sub-manager; returns a typed AdversaryPathwaysGroup model.

AgentHarnessManager.list_simulations(group_id: Optional[str] = None, page: int = 1, per_page: int = 50)

List adversarial simulations, optionally scoped to one run group.

Delegates to the sub-manager's get_list so the filter is built by the shared _build_filter_string (value-escaped) and items come back as AdversarySimulations model instances.

AgentHarnessManager.list_simulations_for_agents(agent_ids: List[str], per_agent: int = 2, status: Optional[str] = None)

List the newest simulation run groups for each requested agent.

The simulations index in the product is backed by adversary_pathways_group. Those run-group records carry agent_id; the child adversary_simulations records only carry pathways_group and therefore cannot be filtered by agent directly. Keep this lookup separate from list_simulations(group_id=...) so callers cannot accidentally use an agent ID as a group ID.

AgentHarnessManager.get_simulation(simulation_id: str)

Get a single adversarial simulation by id.

AgentHarnessManager.get_status(group_id: str)

Get full simulation-group status (custom gateway-pb endpoint).

AgentHarnessManager.cancel(group_id: str)

Cancel a running simulation group (custom gateway-pb endpoint).

AgentHarnessManager.run_and_wait(agent_id: str, pathway_ids: List[str], name: Optional[str] = None, agent_name: Optional[str] = None, run_as_profile: Optional[str] = None, poll_interval: float = 3.0, timeout: float = 1800.0)

Start a run and poll its status until the group reaches a terminal state.

AgentHarnessManager.get_sf_profiles(connection_id: str)

Get Salesforce user profiles for the Run-As-User (RBAC) picker.

AgentHarnessManager.list_agent_profiles(search: Optional[str] = None, connection_id: Optional[str] = None, page: int = 1, per_page: int = 50)

List Agentforce agent profiles in the tenant (with their profiling status).

AgentHarnessManager.generate_more_pathways(agent_id: str, directional_prompt: Optional[str] = None, count: Optional[int] = None, allow_destructive: bool = False, name: Optional[str] = None)

Start another pathway-generation run for an existing agent.

Creates an adversary_pathways_run record (is_submit starts the workflow), the same record the app's "Generate more pathways" creates. count (1 to 100) or None to let the platform choose. Raises TestZeusRequestError when the platform refuses the run (for example, another run of the agent is in progress).

AgentHarnessManager.list_generation_runs(agent_id: str, page: int = 1, per_page: int = 20)

List the pathway-generation runs of an agent, newest first, with status and counts.

AgentHarnessManager.get_pathway(pathway_id: str)

Get one pathway by record id.

AgentHarnessManager.update_pathway(pathway_id: str, objective: Optional[str] = None, expected_outcome: Optional[str] = None, max_turns: Optional[int] = None, risk_level: Optional[str] = None)

Edit a pathway's objective, expected outcome, turn limit (1 to 200) or risk level.

AgentHarnessManager.list_reports(agent_id: Optional[str] = None, group_id: Optional[str] = None, page: int = 1, per_page: int = 20)

List simulation reports (one per run group), newest first, with pass rates and verdicts.

AgentHarnessManager.get_report(report_id: str)

Get one simulation report with its summaries and dimension averages.

AgentHarnessManager.download_report(report_id: str, format: str = "pdf", output_dir: str = "downloads")

Download a report export (pdf, csv, zip or ctrf) into output_dir and return the file path.

The file keeps its platform name (a number is added when that name is taken) and is written whole or not at all.

AgentHarnessManager.pathway_trends(agent_id: str)

Pass/fail trend of each pathway of an agent across its runs.

AgentHarnessManager.pathway_run_history(agent_id: str, pathway_id: str)

Every run of one pathway, for comparing outcomes over time.

BaseManager

Base manager class for all TestZeus entities.

This class provides common CRUD operations for all entity types.

BaseManager.get_list(page: int = 1, per_page: int = 30, filters: Optional[Dict[str, Any]] = None, sort: Optional[Union[str, List[str]]] = None, expand: Optional[Union[str, List[str]]] = None)

Get a list of entities with optional filtering.

Args: page: Page number (1-based) per_page: Number of items per page filters: Dictionary of filter conditions sort: Field(s) to sort by (prefix with '-' for descending order) expand: Related collection(s) to expand

Returns: Dictionary containing items and pagination info

BaseManager.get_one(id_or_name: str, expand: Optional[Union[str, List[str]]] = None)

Get a single entity by ID or name.

Args: id_or_name: Entity ID or name expand: Fields to expand in the response

Returns: Entity model instance

BaseManager.get_first_item(filters: Optional[Dict[str, Any]] = None)

Get the first item from the collection based on optional filters.

Args: filters: Dictionary of filter conditions

Returns: First item from the collection

BaseManager.check_duplicate(data: Dict[str, Any])

Check if a record with the same name exists in the current tenant.

Args: data: Entity data to check for duplicates

Returns: Existing record if found, None otherwise

BaseManager.create(data: Dict[str, Any])

Create a new entity.

Args: data: Entity data

Returns: Created entity model instance

Raises: ValueError: If a record with the same name already exists or if creation fails

BaseManager.update(id_or_name: str, data: Dict[str, Any])

Update an existing entity.

Args: id_or_name: Entity ID or name data: Updated entity data

Returns: Updated entity model instance

BaseManager.delete(id_or_name: str)

Delete an entity.

Args: id_or_name: Entity ID or name

Returns: True if deletion was successful

ConnectedEnvironmentManager

Manager class for TestZeus connected environment entities.

Connected environments are provisioned by the platform and are read-only from the SDK, apart from renaming. This manager therefore exposes only read operations (inherited get_one / get_list) and update for the name field. Creation, deletion, tag changes and file operations are intentionally not supported.

ConnectedEnvironmentManager.update(id_or_name: Text, data: Dict[str, Any])

Update an existing connected environment.

Args: id_or_name: Connected environment ID or name data: Updated connected environment data

Returns: Updated connected environment instance

ConnectedEnvironmentManager.update_connected_environment(id_or_name: Text, name: Text)

Rename an existing connected environment.

Only the name field can be updated on a connected environment.

Args: id_or_name: Connected environment ID or name name: New name of the connected environment

Returns: Updated connected environment instance

DevicePoolManager

Read-only manager for TestZeus device pool entities.

Device pool entries represent available mobile devices for test execution. Create, update, and delete operations are not supported.

DevicePoolManager.create(data: Dict[str, Any])

DevicePoolManager.update(id_or_name: str, data: Dict[str, Any])

DevicePoolManager.delete(id_or_name: str)

EnvironmentManager

Manager class for TestZeus environment entities.

This class provides CRUD operations and specialized methods for working with environment entities.

EnvironmentManager.create(data: Dict[str, Any])

Create a new environment.

Args: data: Environment data

Returns: Created environment instance

EnvironmentManager.create_environment(name: Text, device_type: DeviceType = "browser", supporting_data_files: Optional[Text] = None, mobile_supporting_data_file: Optional[Text] = None, mobile_device: Optional[Text] = None, data: Optional[Any] = None, tags: Optional[List[Text]] = None, connected_environments: Optional[List[Text]] = None, email_manager: Optional[List[Text]] = None, source_code_integrations: Optional[List[Text]] = None, agent_grounding_prompt: Optional[Any] = None)

Create a new environment with individual fields.

Args: name: Name of the environment device_type: Device type ('browser', 'mobile-android', or 'mobile-ios'). Defaults to 'browser'. supporting_data_files: Path to supporting data files (browser only) mobile_supporting_data_file: Path to mobile app file - APK/ZIP (mobile only) mobile_device: Device pool ID or device_name (mobile only) data: Environment data as a dict or JSON string in the format {"items": [{"key": "...", "value": "...", "type": "variable|secret"}]} tags: List of tag IDs or names (names must be existing tags) connected_environments: List of connected environment IDs or names (browser only) email_manager: List of email manager integration IDs or names (browser only) source_code_integrations: List of source code integration IDs or names agent_grounding_prompt: Dict or JSON string with 'test_creation' and/or 'test_execution' keys; missing keys default to ""

Returns: Created environment instance

EnvironmentManager.update(id_or_name: Text, data: Dict[str, Any])

Update an existing environment.

Args: id_or_name: Environment ID or name data: Updated environment data

Returns: Updated environment instance

EnvironmentManager.update_environment(id_or_name: Text, name: Optional[Text] = None, device_type: Optional[DeviceType] = None, supporting_data_files: Optional[Text] = None, mobile_supporting_data_file: Optional[Text] = None, mobile_device: Optional[Text] = None, env_data: Optional[Any] = None, tags: Optional[List[Text]] = None, connected_environments: Optional[List[Text]] = None, email_manager: Optional[List[Text]] = None, source_code_integrations: Optional[List[Text]] = None, agent_grounding_prompt: Optional[Any] = None)

Update an existing environment with individual fields.

agent_grounding_prompt keys that are not provided keep their current value ('test_creation' / 'test_execution' merge, not replace).

Args: id_or_name: Environment ID or name name: Name of the environment device_type: Device type ('browser', 'mobile-android', or 'mobile-ios') supporting_data_files: Path to supporting data files (browser only) mobile_supporting_data_file: Path to mobile app file (mobile only) mobile_device: Device pool ID or device_name (mobile only) env_data: Environment data as a dict or JSON string tags: List of tag IDs or names (names must be existing tags) connected_environments: List of connected environment IDs or names (browser only) email_manager: List of email manager integration IDs or names (browser only) source_code_integrations: List of source code integration IDs or names agent_grounding_prompt: Dict or JSON string with 'test_creation' and/or 'test_execution' keys; keys not provided keep their current value

Returns: Updated environment instance

Raises: ValueError: If no fields are provided to update

EnvironmentManager.add_file(id_or_name: str, file_name: str)

Add a supporting data file to a browser environment.

EnvironmentManager.remove_file(id_or_name: str, file_name: str)

Remove a supporting data file from a browser environment.

file_name may be the stored file name, the original upload name (display name), or a local path to the originally uploaded file.

Raises: ValueError: If no stored file matches the given file name

EnvironmentManager.remove_all_files(id_or_name: str)

Remove all supporting data files from a browser environment.

EnvironmentManager.add_mobile_file(id_or_name: str, file_name: str)

Upload a mobile app file (APK/ZIP) to a mobile environment.

EnvironmentManager.remove_mobile_file(id_or_name: str)

Remove the mobile app file from a mobile environment.

EnvironmentManager.add_tags(id_or_name: str, tags: List[str])

Add tags to an environment.

Args: id_or_name: Environment ID or name tags: List of tag names or IDs

Returns: Updated environment instance

ExtensionManager

Manager class for TestZeus extension entities.

This class provides CRUD operations for working with extension entities.

HypermindCodeBlocksManager

Manager class for TestZeus hypermind_code_blocks entities.

This class provides CRUD operations and specialized methods for working with hypermind_code_blocks entities.

HypermindCodeBlocksManager.create(data: Dict[str, Any])

Create a new hypermind code blocks.

Args: data: HypermindCodeBlocks data

Returns: Created hypermind_code_blocks instance

HypermindCodeBlocksManager.create_hypermind_code_blocks(name: Text, code_files: Optional[Text] = None, tags: Optional[List[Text]] = None)

Create new hypermind code blocks with individual fields.

Args: name: Name of the code blocks code_files: Path to code files tags: List of tag IDs

Returns: Created hypermind_code_blocks instance

HypermindCodeBlocksManager.update(id_or_name: Text, data: Dict[str, Any])

Update existing hypermind code blocks.

Args: id_or_name: HypermindCodeBlocks ID or name data: Updated hypermind_code_blocks data

Returns: Updated hypermind_code_blocks instance

HypermindCodeBlocksManager.update_hypermind_code_blocks(id_or_name: Text, name: Optional[Text] = None, code_files: Optional[Text] = None, tags: Optional[List[Text]] = None)

Update existing hypermind code blocks with individual fields.

Args: id_or_name: HypermindCodeBlocks ID or name name: Name of the code blocks code_files: Path to code files tags: List of tag IDs

Returns: Updated hypermind_code_blocks instance

HypermindCodeBlocksManager.add_file(id_or_name: str, file_name: str)

Add a file to hypermind code blocks.

HypermindCodeBlocksManager.remove_file(id_or_name: str, file_name: str)

Remove a file from hypermind code blocks.

HypermindCodeBlocksManager.remove_all_files(id_or_name: str)

Remove all files from hypermind code blocks.

HypermindCodeBlocksManager.add_tags(id_or_name: str, tags: List[str])

Add tags to hypermind code blocks.

Args: id_or_name: HypermindCodeBlocks ID or name tags: List of tag names or IDs

Returns: Updated hypermind_code_blocks instance

KnowledgeBaseManager

Manager for KnowledgeBase resources.

Provides CRUD operations for managing knowledge bases which are used to enhance test generation with contextual information.

NotificationChannelManager

Manager class for TestZeus notification channel entities.

This class provides CRUD operations for working with notification channel entities.

NotificationChannelManager.create_notification_channel(name: str, emails: list[str], display_name: str = None, tenant: str = None, created_by: str = None, webhooks: list[str] = None, slack: SlackConfig = None, jira: dict[str, any] = None, is_active: bool = True, is_default: bool = True)

Create a new notification channel. Args: name: Name of the notification channel display_name: Display name of the notification channel tenant: Tenant ID (optional, will use authenticated tenant if not provided) created_by: user ID (optional, will use authenticated user if not provided) emails: list of emails webhooks: list of webhooks slack: dictionary of slack config with token and channel_id example: {"token": "xoxb-your-token", "channel_id": "C0605HWSGNN"} jira: dictionary of jira config with project_key and issue_type example: {"project_key": "TEST", "issue_type": "Task"} is_active: Set as active notification channel (default: True) is_default: Set as default notification channel (default: True) Returns: NotificationChannel: The created notification channel

NotificationChannelManager.update_notification_channel(id_or_name: str, name: str = None, display_name: str = None, tenant: str = None, created_by: str = None, emails: list[str] = None, webhooks: list[str] = None, slack: SlackConfig = None, jira: dict[str, any] = None, is_active: bool = True, is_default: bool = True)

Update a notification channel. Args: id_or_name: ID or name of the notification channel name: Name of the notification channel display_name: Display name of the notification channel tenant: Tenant ID (optional, will use authenticated tenant if not provided) created_by: user ID (optional, will use authenticated user if not provided) emails: list of emails webhooks: list of webhooks slack: dictionary of slack config with token and channel_id example: {"token": "xoxb-your-token", "channel_id": "C0605HWSGNN"} jira: dictionary of jira config with project_key and issue_type example: {"project_key": "TEST", "issue_type": "Task"} is_active: Set as active notification channel (default: True) is_default: Set as default notification channel (default: True) Returns: NotificationChannel: The updated notification channel

NotificationChannelManager.remove_config(id_or_name: str, config_type: Literal["webhook", "slack", "jira"])

Remove a configuration from a notification channel. Args: id_or_name: ID or name of the notification channel config_type: Type of configuration to remove Returns: NotificationChannel: The updated notification channel

TagManager

Manager class for TestZeus tag entities.

This class provides CRUD operations and specialized methods for working with tag entities.

TagManager.create(data: Dict[str, Any])

Create a new tag.

Args: data: Tag data

Returns: Created tag instance

TagManager.create_tag(name: str, value: Optional[str] = None)

Create a new tag with individual fields.

Args: name: Name of the Tag value: Value for the Tag

Returns: Created tag instance

TagManager.update(id_or_name: str, data: Dict[str, Any])

Update an existing tag.

Args: id_or_name: Tag ID or name data: Updated tag data

Returns: Updated tag instance

TagManager.update_tag(id_or_name: str, name: Optional[str] = None, value: Optional[str] = None)

Update an existing tag with individual fields.

Args: id_or_name: Tag ID or name name: New name for the Tag value: New value for the Tag (pass "" to clear it)

Returns: Updated tag instance

Raises: ValueError: If neither name nor value is provided

TagManager.find_or_create(name: str, value: Optional[str] = None)

Find a tag by name or create it if it doesn't exist.

Args: name: Tag name value: Optional tag value

Returns: Existing or newly created tag instance

TagsManager

Manager for Tags resources

TenantConsumptionLogsManager

Manager for TenantConsumptionLogs resources

TenantConsumptionManager

Manager for TenantConsumption resources

TenantsManager

Manager for Tenants resources

SplitReviewRequired

Verify is held: these steps are not one browser action each. Apply or dismiss each split, then verify again.

held lists {"step_id", "label", "status", "reason", "candidates": [{"id", "label", "instruction"}]}.

TestBlocksManager

Author, verify, save, and run Test Blocks tests (client.test_blocks).

TestBlocksManager.create(name: str, testing_type: str = "web", environment: Optional[str] = None, test_data: Optional[List[str]] = None, knowledge_base_id: Optional[List[str]] = None, idempotency_key: Optional[str] = None)

Create an empty Test Blocks test. Returns the full builder payload (id, blocks, validation...).

TestBlocksManager.get(test_id: str)

Full builder payload: block_graph, blocks, validation, builder_status, block_graph_hash.

TestBlocksManager.get_progress(test_id: str)

Light progress payload: per-step verificationStatus and the open session's authoringProgress.

TestBlocksManager.update_config(test_id: str, environment: Optional[str] = None, environment_url_key: Optional[str] = None, test_data: Optional[List[str]] = None, knowledge_base_id: Optional[List[str]] = None, step_retry_count: Optional[int] = None)

Change the test's environment, test data, knowledge bases, or step retry count.

TestBlocksManager.add_step(test_id: str, instruction: str = "", step_type: Optional[str] = None, source: Optional[str] = None, label: Optional[str] = None, after_step_id: Optional[str] = None, request: Optional[Dict[str, Any]] = None, is_assert: bool = False, target_org: Optional[str] = None, prepend: bool = False, assert_mode: Optional[str] = None)

Add one step. Appends after the last step unless after_step_id or prepend is given.

is_assert makes the step a check. assert_mode (hard, the default, or soft) says what a failed check does to a run: hard stops it, soft records the failure and goes on. Giving it implies a check.

source is Python run as-is (page/expect/tz for browser steps, tz only for backend). Without source the step is generated from instruction when it is verified. request is the typed form for soql/apex/http steps, e.g. {"query": "...", "outputName": "accounts"}.

TestBlocksManager.update_step(test_id: str, step_id: str, instruction: Optional[str] = None, source: Optional[str] = None, label: Optional[str] = None, step_type: Optional[str] = None, request: Optional[Dict[str, Any]] = None, is_assert: Optional[bool] = None, target_org: Optional[str] = None, assert_mode: Optional[str] = None)

Edit one step. Changing source marks it unverified, so verify again before saving.

assert_mode (hard or soft) makes the step a check with that mode; is_assert=False makes it an action again and drops the mode.

TestBlocksManager.delete_steps(test_id: str, step_ids: List[str])

Delete steps; the remaining steps are reconnected in order.

TestBlocksManager.verify(test_id: str, through_step_id: Optional[str] = None, browser_session_id: Optional[str] = None)

Run the steps in order (all, or up to through_step_id) so they can be verified.

The worker leases a browser when a browser step needs one; backend-only ranges run without one. Returns {"status": "queued"|"already_current", ...}; follow with wait_for_verify.

Two refusals need a fresh authoring session: the browser of an earlier verify has ended (BROWSER_SESSION_ENDED, e.g. it timed out after a failed step), or the session already ran a step that was edited since (AUTHORING_SESSION_AHEAD, e.g. after update_step reworded it). Without an explicit browser_session_id this stops that session and starts the verify once more from the first step, as the UI's restart does.

The one-action review that runs first (:meth:review_steps) runs in the same browser. Its BROWSER_SESSION_ENDED is raised, not restarted: the gateway replaces a session on an ended browser nobody opened by itself, so that refusal means a browser the author opened in the builder, which is theirs to start again.

TestBlocksManager.review_steps(test_id: str, through_step_id: Optional[str] = None, browser_session_id: Optional[str] = None)

Check that each plain-language browser step up to through_step_id is one action, as the builder does.

Steps not reviewed yet (and not verified already) are sent for review and awaited. Raises :class:SplitReviewRequired when any step must be split (apply_split), reworded, or kept as one on purpose (dismiss_split). A review the gateway could not queue, found on the test or returned by the first ask, is asked once more per call before it holds. browser_session_id is the browser the reviews run in, as for :meth:verify.

TestBlocksManager.apply_split(test_id: str, step_id: str, candidate_ids: Optional[List[str]] = None)

Replace a step with the steps its split review suggested (all of them unless candidate_ids is given).

TestBlocksManager.dismiss_split(test_id: str, step_id: str)

Keep a step as one action although its review suggested a split (the builder's "keep as is").

TestBlocksManager.wait_for_verify(test_id: str, timeout: float = 900, poll_interval: float = 5)

Poll until the verify run stops. Returns the final progress payload.

Inspect blocks[].verificationStatus and authoringProgress.errorReason for the outcome. Why a step failed is authoring_progress.failure on its block (from :meth:get): headline is what went wrong and recommendation how to fix it, as the model wrote them. How the step was run (raw error, cause, trace) is not sent to customer tokens.

TestBlocksManager.save(test_id: str, force: bool = False)

Save the graph and snapshot a version. builder_status becomes ready or invalid.

TestBlocksManager.live_run(test_id: str, key: Optional[str] = None)

Start an official run. The test must be saved and ready.

Returns {"status": "queued", "executor": "test_blocks", "group_id", "test_run_id"}.

TestBlocksManager.stop_session(session_id: str)

Cancel an authoring session (authoring_sitting.id on the test payload) and release its browser.

TestBlocksManager.end_session(test_id: str)

End the test's current authoring session, if it has one.

The next verify starts a new browser.

Returns the stopped session, or None when there was none.

TestBlocksManager.step_screenshot(test_id: str, step_id: Optional[str] = None, output_dir: str = "downloads")

Download the proof screenshot of a verified step: the page it left.

Defaults to the last verified step in run order, so a client authoring step by step can see the page before it writes the next step. A named step may sit inside a loop or condition. A step edited since it was verified has no proof yet: its old screenshot shows the page before the edit, so it is refused. Returns {"step_id", "label", "path"}.

TestBlocksManager.get_run_status(test_run_id: str)

Aggregated status of a test run, including dash steps and attachments.

TestDataManager

Manager class for TestZeus test data entities.

This class provides CRUD operations and specialized methods for working with test data entities.

TestDataManager.create(data: Dict[str, Any])

Create a new test data entity.

Args: data: Test data with potentially name-based references

Returns: Created test data instance

TestDataManager.create_test_data(name: str, type: Literal["test", "design", "run"] = "test", content: Optional[Any] = None, supporting_data_files: str = None, tags: List[str] = None, agent_grounding_prompt: Optional[Any] = None)

Create a new test data entity.

Args: name: Name of the test data type: Type of the test data content: Data of the test data, as a dict or JSON string in the format {"items": [{"key": "...", "value": "...", "type": "variable|secret"}]} supporting_data_files: Supporting data files of the test data tags: Tags of the test data (names or IDs; names must be existing tags) agent_grounding_prompt: Dict or JSON string with 'test_creation' and/or 'test_execution' keys; missing keys default to ""

Returns: Created test data instance

TestDataManager.update_test_data(id_or_name: str, name: str = None, type: Literal["test", "design", "run"] = None, content: Optional[Any] = None, supporting_data_files: str = None, tags: List[str] = None, cached_prompt_details: str = None, agent_grounding_prompt: Optional[Any] = None)

Update a test data entity.

agent_grounding_prompt keys that are not provided keep their current value ('test_creation' / 'test_execution' merge, not replace).

Raises: ValueError: If no fields are provided to update

TestDataManager.add_file(id_or_name: str, file_name: str)

Add a file to a test data entity.

TestDataManager.remove_file(id_or_name: str, file_name: str)

Remove a file from a test data entity.

file_name may be the stored file name, the original upload name (display name), or a local path to the originally uploaded file.

Raises: ValueError: If no stored file matches the given file name

TestDataManager.remove_all_files(id_or_name: str)

Remove all files from a test data entity.

TestDataManager.download_all_files(id_or_name: str, output_dir: str = "downloads")

Download all supporting files from a test data collection.

Args: id_or_name (str): The ID or name of the test data collection output_dir (str, optional): Directory to save the downloaded files. Defaults to "downloads".

Returns: List[str]: List of paths to the downloaded files

TestDesignsManager

Manager for TestDesigns resources

TestDeviceManager

Manager for TestDevice resources

TestManager

Manager class for TestZeus test entities.

This class provides CRUD operations and specialized methods for working with test entities.

TestManager.create(data: Dict[str, Any])

Create a new Test entity.

Args: data: Test data

Returns: Test: The created Test instance.

TestManager.create_test(name: str, test_feature: str, test_params: Optional[Dict[str, Any]] = None, test_data: Optional[List[str]] = None, hypermind_code_blocks: Optional[List[str]] = None, tags: Optional[List[str]] = None, environment: Optional[str] = None, output_schema: Optional[Dict[str, Any]] = None, execution_mode: Optional[Literal["lenient", "strict"]] = "lenient", testing_type: Literal["web", "mobile"] = "web")

Create a new Test entity with individual fields.

Args: name: Name of the test. Required and Unique. test_feature: Associated test feature. Required. test_params: Default test input values. test_data: Test data IDs. hypermind_code_blocks: Hypermind code blocks IDs. tags: Tag IDs. environment: Environment ID. Required when testing_type is 'mobile'. output_schema: Output schema definition. execution_mode: Execution mode ('lenient' or 'strict'). testing_type: Testing type ('web' or 'mobile'). Defaults to 'web'.

Returns: Test: The created Test instance.

TestManager.update(id_or_name: str, data: Dict[str, Any])

Update an existing Test entity.

Args: id_or_name: Test ID or name data: Updated test data

Returns: Test: The updated Test instance.

TestManager.update_test(id_or_name: str, name: Optional[str] = None, test_feature: Optional[str] = None, test_params: Optional[Dict[str, Any]] = None, test_data: Optional[List[str]] = None, hypermind_code_blocks: Optional[List[str]] = None, tags: Optional[List[str]] = None, environment: Optional[str] = None, output_schema: Optional[Dict[str, Any]] = None, execution_mode: Optional[Literal["lenient", "strict"]] = None, testing_type: Optional[Literal["web", "mobile"]] = None)

Update an existing Test entity with individual fields.

Args: id_or_name: Test ID or name name: Name of the test. test_feature: Associated test feature. test_params: Default test input values. test_data: Test data IDs. hypermind_code_blocks: Hypermind code blocks IDs. tags: Tag IDs. environment: Environment ID. Required when testing_type is 'mobile'. output_schema: Output schema definition. execution_mode: Execution mode. testing_type: Testing type ('web' or 'mobile').

Returns: Test: The updated Test instance.

TestManager.run_tests(ids_or_names: List[str], name: str, execution_mode: Optional[Literal["lenient", "strict"]] = "lenient", modified_by: Optional[str] = None, tenant: Optional[str] = None, environment: Optional[str] = None, tags: Optional[List[str]] = None, notification_channels: Optional[List[str]] = None)

Create and start a test run for a test.

Args: ids_or_names: List of test IDs or names name: Name for the test run group execution_mode: Execution mode (optional) environment: Environment name or ID (optional) tags: List of tag names or IDs (optional) notification_channels: List of notification channel names or IDs (optional) modified_by: User ID who is modifying the test run (optional) tenant: Tenant ID to associate with this test run (optional) Returns: Created test run data

TestManager.get_input_params(test_id: str)

Fetch merged input parameters and defaults for a test.

TestManager.get_dependent_test_suites(test_id: str)

Fetch test suites whose extracted tests relation includes this test.

TestManager.add_tags(id_or_name: str, tags: List[str])

Add tags to a test.

Args: id_or_name: Test ID or name tags: List of tag names or IDs

Returns: Updated test instance

TestReportDashRunManager

Manager class for TestZeus test report dash run entities.

This class provides CRUD operations for working with test report dash run entities.

TestReportRunManager

Manager class for TestZeus test report run entities.

This class provides CRUD operations for working with test report run entities.

TestReportRunManager.download_report(id_or_name: str, output_dir: str = "downloads", format: str = Literal["ctrf", "pdf", "csv", "zip"])

Download the report for a test report run.

TestReportScheduleManager

Manager class for TestZeus test report schedule entities.

This class provides CRUD operations for working with test report schedule entities.

TestReportScheduleManager.create_test_report_schedule(name: str, is_active: bool = True, filter_name_pattern: str = None, filter_time_intervals: FilterTimeIntervals = None, cron_expression: str = None, filter_tags: list[str] = None, filter_tag_pattern: str = None, filter_env: list[str] = None, filter_env_pattern: str = None, filter_test_data: list[str] = None, filter_test_data_pattern: str = None, notification_channels: list[str] = None)

Create a new test report schedule. Args: name: Name of the test report schedule is_active: Set as active test report schedule (default: True) filter_name_pattern: Filter using TestRun name pattern filter_time_intervals: Filter using time intervals (mutually exclusive with cron_expression) example: {"start_time": "2025-01-01 00:00:00", "end_time": "2025-01-01 01:00:00"} cron_expression: Cron expression (mutually exclusive with filter_time_intervals) filter_tags: Filter using tags (mutually exclusive with filter_tag_pattern) filter_tag_pattern: Filter using tag pattern (mutually exclusive with filter_tags) filter_env: Filter using environments (mutually exclusive with filter_env_pattern) filter_env_pattern: Filter using environment pattern (mutually exclusive with filter_env) filter_test_data: Filter using test data (mutually exclusive with filter_test_data_pattern) filter_test_data_pattern: Filter test data pattern (mutually exclusive with filter_test_data) notification_channels: Filter notification channels Returns: TestReportSchedule: The created test report schedule Raises: ValueError: If validation rules are violated or creation fails

TestReportScheduleManager.update_test_report_schedule(id_or_name: str, name: str = None, is_active: bool = True, filter_name_pattern: str = None, filter_time_intervals: FilterTimeIntervals = None, cron_expression: str = None, filter_tags: list[str] = None, filter_tag_pattern: str = None, filter_env: list[str] = None, filter_env_pattern: str = None, filter_test_data: list[str] = None, filter_test_data_pattern: str = None, notification_channels: list[str] = None)

Update a test report schedule. Args: id_or_name: ID or name of the test report schedule name: Name of the test report schedule is_active: Set as active test report schedule (default: True) filter_name_pattern: Filter using TestRun name pattern filter_time_intervals: Filter using time intervals (mutually exclusive with cron_expression) example: {"start_time": "2025-01-01 00:00:00", "end_time": "2025-01-01 01:00:00"} cron_expression: Cron expression (mutually exclusive with filter_time_intervals) filter_tags: Filter using tags (mutually exclusive with filter_tag_pattern) filter_tag_pattern: Filter using tag pattern (mutually exclusive with filter_tags) filter_env: Filter using environments (mutually exclusive with filter_env_pattern) filter_env_pattern: Filter using environment pattern (mutually exclusive with filter_env) filter_test_data: Filter using test data (mutually exclusive with filter_test_data_pattern) filter_test_data_pattern: Filter using test data pattern (mutually exclusive with filter_test_data) notification_channels: Filter notification channels Returns: TestReportSchedule: The updated test report schedule Raises: ValueError: If validation rules are violated or update fails

TestRunDashOutputStepsManager

Manager for TestRunDashOutputSteps resources

TestRunDashOutputsAttachmentsManager

Manager for TestRunDashOutputsAttachments resources

TestRunDashOutputsAttachmentsManager.download_attachment(id_or_name: str, output_dir: str = ".")

Download an attachment file by its ID or name.

Args: id_or_name: ID or name of the attachment output_dir: Directory where the file should be downloaded to (defaults to current directory)

Returns: Path to the downloaded file as string if successful, None otherwise

TestRunDashOutputsManager

Manager for TestRunDashOutputs resources

TestRunDashsManager

Manager for TestRunDashs resources

TestRunDashsManager.get_expanded(test_run_id: str)

Get complete expanded tree of a test run with all details

Args: test_run_id: Test run ID

Returns: Complete test run tree with all details

TestRunDashsManager.cancel(test_run_id: str)

Cancel a test run

Args: test_run_id: Test run ID

Returns: True if successful

TestRunGroupManager

Manager class for TestZeus test run group entities.

This class provides CRUD operations and specialized methods for working with test run group entities.

TestRunGroupManager.create_and_execute(name: str, test_ids: Optional[List[str]] = None, execution_mode: Literal["lenient", "strict"] = "lenient", environment: Optional[str] = None, tags: Optional[List[str]] = None, notification_channels: Optional[List[str]] = None, tenant: Optional[str] = None, created_by: Optional[str] = None, manual: bool = False)

Create a test run group and prepare it for execution.

Args: name: Name for the test run group test_ids: List of test IDs to include in the group (use either test_ids OR tags, not both) execution_mode: Execution mode for the tests (lenient or strict) environment: Optional environment ID tags: Optional list of tag IDs to filter tests (use either test_ids OR tags, not both) notification_channels: Optional list of notification channel IDs tenant: Tenant ID (optional, will use authenticated tenant if not provided) created_by: User ID who is creating the group (optional, will use authenticated user if not provided) manual: Make every run a manual run assigned to the creator, who is emailed; a person must complete it

Returns: Created test run group instance

Raises: ValueError: If both test_ids and tags are specified, or if neither is specified ValueError: If manual is set and the server does not support manual runs; the created group is cancelled first

TestRunGroupManager.cancel_group(id_or_name: str)

Cancel all running test runs in a group.

Args: id_or_name: Test run group ID or name

Returns: Updated test run group instance

TestRunGroupManager.download_report(id_or_name: str, output_dir: str = "downloads", format: Literal["ctrf", "pdf", "csv", "zip"] = "pdf")

Download the report for a test run group.

TestRunGroupManager.download_all_attachments(id_or_name: str, output_dir: str = "downloads")

Download all attachments for all test runs in a test run group. Each test run will have its own folder within the test run group folder.

Args: id_or_name: Test run group ID or name output_dir: Base directory to save attachments (default: "downloads")

Returns: Dictionary mapping test run names to lists of downloaded attachment filenames

Directory structure: downloads/<test-run-group-name>/<test-run-name>/

TestRunGroupManager.execute_and_monitor(name: str, test_ids: Optional[List[str]] = None, execution_mode: Literal["lenient", "strict"] = "lenient", environment: Optional[str] = None, tags: Optional[List[str]] = None, notification_channels: Optional[List[str]] = None, tenant: Optional[str] = None, created_by: Optional[str] = None, sleep_interval: int = 30, output_dir: str = "downloads", format: Literal["ctrf", "pdf", "csv", "zip"] = "ctrf", filename: str = "ctrf-report.json")

Create a test run group and prepare it for execution.

Args: name: Name for the test run group test_ids: List of test IDs to include in the group (use either test_ids OR tags, not both) execution_mode: Execution mode for the tests (lenient or strict) environment: Optional environment ID tags: Optional list of tag IDs to filter tests (use either test_ids OR tags, not both) notification_channels: Optional list of notification channel IDs tenant: Tenant ID (optional, will use authenticated tenant if not provided) created_by: User ID who is creating the group (optional, will use authenticated user if not provided)

Returns: Created test run group instance

Raises: ValueError: If both test_ids and tags are specified, or if neither is specified

TestRunGroupManager.execute_and_monitor_status(name: str, test_ids: Optional[List[str]] = None, environment: Optional[str] = None, tags: Optional[List[str]] = None, notification_channels: Optional[List[str]] = None, tenant: Optional[str] = None, created_by: Optional[str] = None, sleep_interval: int = 30)

Create a test run group and monitor until status is completed.

Unlike execute_and_monitor(), this method only monitors the group status without waiting for CTRF report generation or downloading reports. Always uses "lenient" execution mode.

Note: You must specify either test_ids OR tags, but not both. This validation is enforced by create_and_execute().

Args: name: Name for the test run group test_ids: List of test IDs to include (use either test_ids OR tags) environment: Optional environment ID tags: Optional list of tag IDs (use either test_ids OR tags) notification_channels: Optional list of notification channel IDs tenant: Tenant ID (optional) created_by: User ID creating the group (optional) sleep_interval: Seconds between status checks (default: 30)

Returns: Completed TestRunGroup instance, or None if cancelled/failed/error

Raises: ValueError: If both test_ids and tags are specified, or if neither is specified

TestRunManager

Manager class for TestZeus test run entities.

This class provides CRUD operations and specialized methods for working with test run entities.

TestRunManager.cancel(id_or_name: str, modified_by: Optional[str] = None, tenant: Optional[str] = None)

Cancel a test run.

Args: id_or_name: Test run ID or name modified_by: User ID who is canceling the test run (optional) tenant: Tenant ID to associate with this operation (optional)

Returns: Updated test run instance

TestRunManager.create_and_start(name: str, test: str, execution_mode: Literal["lenient", "strict"] = "lenient", environment: Optional[str] = None, tags: Optional[List[str]] = None, tenant: Optional[str] = None, modified_by: Optional[str] = None)

Create and start a test run.

Args: name: Name for the test run test: Test ID or name execution_mode: Execution mode for the test run (optional) environment: Environment ID or name (optional) tags: List of tag IDs or names (optional) tenant: Tenant ID to associate with this test run (optional) modified_by: User ID who is creating the test run (optional)

Returns: Created and started test run instance

TestRunManager.cancel_with_email(id_or_name: str, user_email: str)

Cancel a test run using user email instead of user ID.

Args: id_or_name: Test run ID or name user_email: Email of the user canceling the test run

Returns: Updated test run instance

Raises: ValueError: If user with the email is not found

TestRunManager.get_expanded(id_or_name: str)

Get a test run with all expanded details including outputs, steps, and attachments.

Args: id_or_name: Test run ID or name

Returns: Complete test run tree with all details

TestRunManager.download_all_attachments(id_or_name: str, output_dir: str = ".")

Download all attachments for a test run.

Args: id_or_name: Test run ID or name output_dir: Directory to save attachments

Returns: List of downloaded attachment filenames

TestRunManager.run_multiple_tests_and_generate_ctrf_report(test_ids: list[str], tenant: str = None, modified_by: str = None, execution_mode: Literal["lenient", "strict"] = "lenient", ctrf_filename: str = 'ctrf_report.json', interval: int = 30)

Run multiple tests, monitor their progress, and generate CTRF report once completed.

Args: test_ids: List of test IDs tenant: Tenant ID to associate with this test run (optional) modified_by: User ID who is modifying the test run (optional) execution_mode: Execution mode for the test run (optional) ctrf_filename: Custom filename for CTRF report (optional)

Returns: Tuple containing: - List of completed test runs - Path to the generated CTRF report

TestRunReportsManager

Manager for TestRunReports resources

TestRunsManager

Manager for TestRuns resources

TestRunsStageManager

Manager for TestRunsStage resources

TestSuiteManager

Manager class for TestZeus test suite entities.

TestSuiteNodeRunManager

Manager class for TestZeus test suite node run entities.

TestSuiteRunManager

Manager class for TestZeus test suite run entities.

TestSuiteRunManager.pause(suite_run_id: str, mode: str = "graceful", reason: Optional[str] = None)

TestSuiteRunManager.resume(suite_run_id: str)

TestSuiteRunManager.cancel(suite_run_id: str)

TestSuiteRunManager.run(display_name: str, test_suite: str, input_values: Optional[Dict[str, Any]] = None, environment: Optional[str] = None, notification_channels: Optional[List[str]] = None, manual: bool = False)

Create and start a test suite run.

Args: display_name: Display name for the test suite run test_suite: Test suite ID or name input_values: Input values for the workflow (optional) environment: Environment ID or name (optional) notification_channels: List of notification channel IDs or names (optional) manual: Make every run a manual run assigned to the creator, who is emailed; a person must complete it

Returns: Created test suite run instance

Raises: ValueError: If manual is set and the server does not support manual runs; the created suite run is cancelled first

TestSuiteScheduleManager

Manager class for TestZeus test suite schedule entities.

TestsAIGeneratorManager

Manager class for TestZeus tests AI generator entities.

This class provides CRUD operations for working with tests AI generator entities.

TestsAIGeneratorManager.create(data: Dict[str, Any])

TestsManager

Manager for Tests resources

TestsManager.run_test(ids_or_names: List[str], name: str, environment: Optional[str] = None, execution_mode: Optional[Literal["lenient", "strict"]] = "lenient", modified_by: Optional[str] = None, tenant: Optional[str] = None, tags: Optional[List[str]] = None, notification_channels: Optional[List[str]] = None)

Run a test

Args: ids_or_names: List of test IDs or names name: Name for the test run group execution_mode: Execution mode (optional) environment: Environment name or ID (optional) tags: List of tag names or IDs (optional) notification_channels: List of notification channel names or IDs (optional) modified_by: User ID who is modifying the test run (optional) tenant: Tenant ID to associate with this test run (optional) environment: Environment name or ID (optional)

Returns: Test run result

UserIntegrationManager

Manager class for TestZeus user_integration entities.

This class provides read-only operations for user_integration entities.

UserIntegrationManager.get_one(id_or_name: str, expand: Optional[Union[str, List[str]]] = None)

Get a single user integration by ID or name.

Args: id_or_name: UserIntegration ID or name expand: Fields to expand in the response

Returns: UserIntegration model instance

UsersManager

Manager for Users resources

UsersManager.find_by_email(email: str)

Find a user by email address.

Args: email: User email address

Returns: User instance if found, None otherwise