Report API
This page describes the ReportAPI class.
ReportAPI
Class that allows for interacting with reports via API.
Attributes:
Name | Type | Description |
---|---|---|
client |
object
|
client for sending requests to Typhoon Test Hub API |
generate_and_upload_report(results_dir, execution_id, multiple_results=False, tags=None)
Generate an Allure report based on Allure results
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results_dir |
string
|
Path to directory containing Allure results |
required |
execution_id |
int
|
Identifier of execution to which report should be assigned |
required |
multiple_results |
bool
|
Indicator whether results_dir points to directory with multiple Allure results which requires merging multiple Allure results into single Allure report |
False
|
tags |
list
|
List of execution tags where each tag is a string value |
None
|
Returns:
Name | Type | Description |
---|---|---|
identifier |
int
|
Identifier of created report |
Raises:
Type | Description |
---|---|
APIException
|
Response status code not 201 |
InvalidPathException
|
Invalid report path provided |
InvalidDataException
|
Invalid data provided |
get_info(report_id)
Obtain details of the Report with the provided report identifier.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_id |
int
|
Identifier of report |
required |
Returns:
Name | Type | Description |
---|---|---|
data |
dict
|
Report information |
Raises:
Type | Description |
---|---|
APIException
|
Response status code not 200 |
upload_report(report_path, execution_id, report_type='allure', tags=None, summary=None, summary_json=None, test_results=None, test_results_json=None)
Upload a report to Typhoon Test Hub.
Parameters:
Returns:
Name | Type | Description |
---|---|---|
identifier |
int
|
Identifier of created report |
Raises:
Type | Description |
---|---|
APIException
|
Response status code not 201 |
UnsupportedReportTypeException
|
Invalid report type |
InvalidPathException
|
Invalid report path provided |
InvalidDataException
|
Invalid data provided |
upload_results(results_path, execution_id, multiple_results=False, tags=None)
Upload Allure results to Typhoon Test Hub.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results_path |
str
|
Path to directory containing Allure results |
required |
execution_id |
int
|
Identifier of the Execution to which the report should be assigned |
required |
multiple_results |
bool
|
Indicator that results_path contains multiple Allure results (the default value is False) |
False
|
tags |
list
|
List of execution tags where each tag is a string value |
None
|
Returns:
Name | Type | Description |
---|---|---|
identifier |
int
|
Identifier of created report |
Raises:
Type | Description |
---|---|
APIException
|
Response status code not 201 |
InvalidPathException
|
Invalid report path provided |
InvalidDataException
|
Invalid data provided |