SDK reference#

The Python SDK — use it to build TestZeus into your own apps, services, and automation. Install with pip install testzeus-sdk, then from testzeus_sdk import TestZeusClient.

Source: test-zeus-ai/testzeus-sdk · auto-generated from this repo on every build (nightly + on source change) — to change this page, change the code

Quick example#

Create an async client (email/password, or env vars), then call the managers:

import asyncio
from testzeus_sdk import TestZeusClient

async def main():
    async with TestZeusClient(email="[email protected]", password="...") as client:
        tests = await client.tests.get_list(sort="id")          # list tests
        test = await client.tests.get_one(tests["items"][0].id)  # fetch one
        print(test.name, test.status)

asyncio.run(main())

Tip

In CI, set TESTZEUS_EMAIL / TESTZEUS_PASSWORD as env vars and call TestZeusClient() with no arguments.

Every manager (tests, test runs, environments, tags, and more) supports filtering and sorting — e.g. get_list(filters={"status": "active"}, sort="-created"). The full class and method reference follows.

TestZeusClient#

Client for interacting with TestZeus API.

This client wraps the PocketBase client and provides access to all TestZeus functionality through specialized managers for each entity type.

ensure_authenticated()#

Ensure the client is authenticated before making API calls

authenticate(email: str, password: str)#

Authenticate with email and password

Args: email: User email password: User password

Returns: Authentication token

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

is_authenticated()#

Check if the client is authenticated

Returns: True if authenticated

logout()#

Logout and clear authentication state

get_tenant_id()#

Get the current tenant ID

Returns: Tenant ID or default tenant ID if not authenticated

get_tenant_id_async()#

Get the current tenant ID (async version)

get_user_id()#

Get the current User ID

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

get_user_id_async()#

Get the current User ID (async version)

get_file_token()#

Get the current file token

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.

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.

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.

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.

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).

get_agent(agent_id: str)#

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

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.

create_pathway(data: Dict[str, Any])#

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

delete_pathway(pathway_id: str)#

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

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.

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.

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.

get_simulation(simulation_id: str)#

Get a single adversarial simulation by id.

get_status(group_id: str)#

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

cancel(group_id: str)#

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

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.

get_sf_profiles(connection_id: str)#

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

SessionExchangeResponse#

Response from session exchange via auth-refresh.

from_dict(cls, data: Dict[str, Any])#

Create from API response dict.

SessionValidateResponse#

Response from validating a session token.

AuthManager#

Manager for authentication operations.

Provides session exchange functionality using existing PocketBase auth-refresh. This allows Hermes to exchange a UI-provided PocketBase JWT for CLI-compatible auth.

exchange_session(pb_token: str)#

Exchange a PocketBase JWT for a refreshed session token.

This calls POST /api/collections/users/auth-refresh with the provided PocketBase JWT. The refreshed token can be used for CLI operations.

Args: pb_token: PocketBase JWT token from UI

Returns: SessionExchangeResponse with token and user info

Raises: ValueError: If token exchange fails

validate_token(token: str)#

Validate a token by attempting to refresh it.

Args: token: Token to validate

Returns: SessionValidateResponse with validation result

extract_token_info(token: str)#

Extract basic info from a JWT without validation.

This decodes the payload (middle part) of a JWT without verifying the signature. Useful for quick token inspection.

Args: token: JWT token

Returns: Dict with token info (userId, tenantId, exp, etc.) or None if invalid

is_token_expired(token: str)#

Check if a token is expired based on its ‘exp’ claim.

Args: token: JWT token

Returns: True if token is expired, False otherwise

BaseManager#

Base manager class for all TestZeus entities.

This class provides common CRUD operations for all entity types.

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

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

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

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

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

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

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.

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

create(data: Dict[str, Any])#

Create a new connected environment.

Args: data: Connected environment data

Returns: Created connected environment instance

create_connected_environment(name: Text, connection: Optional[Text] = None, tags: Optional[List[Text]] = None, metadata: Optional[Dict[str, Any]] = None, skip_process: bool = False)#

Create a new connected environment with individual fields.

Args: name: Name of the connected environment connection: Connection ID to link with tags: List of tag IDs metadata: Optional metadata dictionary skip_process: Whether to skip processing (default: False)

Returns: Created connected environment instance

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

update_connected_environment(id_or_name: Text, name: Optional[Text] = None, connection: Optional[Text] = None, tags: Optional[List[Text]] = None, metadata: Optional[Dict[str, Any]] = None, skip_process: Optional[bool] = None)#

Update an existing connected environment with individual fields.

Args: id_or_name: Connected environment ID or name name: New name of the connected environment connection: Connection ID to link with tags: List of tag IDs metadata: Optional metadata dictionary skip_process: Whether to skip processing

Returns: Updated connected environment instance

add_metadata_file(id_or_name: str, file_path: str)#

Add a metadata file to a connected environment.

Args: id_or_name: Connected environment ID or name file_path: Path to the file to add

Returns: Updated connected environment instance

remove_metadata_file(id_or_name: str, file_name: str)#

Remove a metadata file from a connected environment.

Args: id_or_name: Connected environment ID or name file_name: Name of the file to remove

Returns: Updated connected environment instance

remove_all_metadata_files(id_or_name: str)#

Remove all metadata files from a connected environment.

Args: id_or_name: Connected environment ID or name

Returns: Updated connected environment instance

add_code_file(id_or_name: str, file_path: str)#

Add a code file to a connected environment.

Args: id_or_name: Connected environment ID or name file_path: Path to the file to add

Returns: Updated connected environment instance

remove_code_file(id_or_name: str, file_name: str)#

Remove a code file from a connected environment.

Args: id_or_name: Connected environment ID or name file_name: Name of the file to remove

Returns: Updated connected environment instance

remove_all_code_files(id_or_name: str)#

Remove all code files from a connected environment.

Args: id_or_name: Connected environment ID or name

Returns: Updated connected environment instance

add_tags(id_or_name: str, tags: List[str])#

Add tags to a connected environment.

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

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.

create(data: Dict[str, Any])#

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

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.

create(data: Dict[str, Any])#

Create a new environment.

Args: data: Environment data

Returns: Created environment instance

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

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

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

add_file(id_or_name: str, file_name: str)#

Add a supporting data file to a browser environment.

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

remove_all_files(id_or_name: str)#

Remove all supporting data files from a browser environment.

add_mobile_file(id_or_name: str, file_name: str)#

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

remove_mobile_file(id_or_name: str)#

Remove the mobile app file from a mobile environment.

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.

create(data: Dict[str, Any])#

Create a new hypermind code blocks.

Args: data: HypermindCodeBlocks data

Returns: Created hypermind_code_blocks instance

create_hypermind_code_blocks(name: Text, status: Literal['draft', 'ready', 'deleted'] = 'draft', 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 status: Status (‘draft’ by default) code_files: Path to code files tags: List of tag IDs

Returns: Created hypermind_code_blocks instance

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

update_hypermind_code_blocks(id_or_name: Text, name: Optional[Text] = None, status: Optional[Literal['draft', 'ready', 'deleted']] = 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 status: Status code_files: Path to code files tags: List of tag IDs

Returns: Updated hypermind_code_blocks instance

add_file(id_or_name: str, file_name: str)#

Add a file to hypermind code blocks.

remove_file(id_or_name: str, file_name: str)#

Remove a file from hypermind code blocks.

remove_all_files(id_or_name: str)#

Remove all files from hypermind code blocks.

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.

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

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

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.

create(data: Dict[str, Any])#

Create a new tag.

Args: data: Tag data

Returns: Created tag instance

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

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

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

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

TestDataManager#

Manager class for TestZeus test data entities.

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

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

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

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

add_file(id_or_name: str, file_name: str)#

Add a file to a test data entity.

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

remove_all_files(id_or_name: str)#

Remove all files from a test data entity.

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.

create(data: Dict[str, Any])#

Create a new Test entity.

Args: data: Test data

Returns: Test: The created Test instance.

create_test(name: str, test_feature: str, status: Literal['draft', 'ready', 'deleted'] = 'draft', 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. status: Status (‘draft’ by default). 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.

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.

update_test(id_or_name: str, name: Optional[str] = None, test_feature: Optional[str] = None, status: Optional[Literal['draft', 'ready', 'deleted']] = 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. status: Status. 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.

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

get_input_params(test_id: str)#

Fetch merged input parameters and defaults for a test.

get_dependent_test_suites(test_id: str)#

Fetch test suites whose extracted tests relation includes this test.

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.

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.

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

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

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

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

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.

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)#

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

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

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.

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///

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

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.

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

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

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

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

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

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.

pause(suite_run_id: str, mode: str = 'graceful', reason: Optional[str] = None)#

resume(suite_run_id: str)#

cancel(suite_run_id: str)#

run(display_name: str, test_suite: str, input_values: Optional[Dict[str, Any]] = None, environment: Optional[str] = None, notification_channels: Optional[List[str]] = None)#

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)

Returns: Created test suite run instance

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.

create(data: Dict[str, Any])#

TestsManager#

Manager for Tests resources

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.

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

find_by_email(email: str)#

Find a user by email address.

Args: email: User email address

Returns: User instance if found, None otherwise