Skip to content

Typhoon Test Hub API client library documentation

Version: 1.2.0

Description

The Typhoon Test Hub API client library (tth-api-client) provides a set of functions for interacting with Typhoon Test Hub API.

Installation

Package is available on PyPI. To install the tth-api-client library from PyPI, use:

pip install tth-api-client

Getting started

To interact with Typhoon Test Hub API, you first need to instantiate a client. APIKeyClient is currently the only supported client that requires an API key for authentication:

from tth.client import APIKeyClient
client = APIKeyClient(hub_address, api_key_value)

You can now trigger an event trigger:

trigger_id = 1
execution_id = client.trigger.start(trigger_id)

You can obtain information of selected Execution:

execution_info = client.execution.get_info(execution_id)

You can wait for the Execution to finish:

execution_status = client.execution.wait_until_finished(execution_id)

You can upload an Allure report:

allure_report_path = "path_to_allure_report_directory"
report_id = client.report.upload_report(allure_report_path, execution_id)

You can upload an artifact:

file_to_upload_path = "some_file.txt"
artifact_id = client.artifact.upload_artifact(file_to_upload_path)

You can download an artifact:

downloaded_file_name = "downloaded_file.txt"
downloaded_file_path = client.artifact.download_artifact(artifact_id, downloaded_file_name)