Project summary
Package providing TM4J Cloud REST API for test automation integration.
Install
How to build
python setup.py sdist
How to install
# PyPi
pip install tm4j-reporter-api
# Git
pip install git+https://github.com/Klika-Tech/tm4j_reporter_api.git
Configure
In order to use TM4J Cloud REST API, you need to configure TM4J reporter with tm4j_api.configure_tm4j_api function first:
from tm4j_reporter_api import tm4j_api
def my_test_run_setup(my_access_key, my_project_key):
tm4j_api.configure_tm4j_api(
api_access_key=my_access_key,
project_key=my_project_key
)
| Param | Mandatory | Description | Type | Example |
|---|---|---|---|---|
| api_access_key | Yes | API key to access TM4j. To get it see Instruction | str | |
| project_key | Yes | Jira / TM4J project prefix without trailing dash | str | QT |
Usage
Test cycle
You need TM4J test cycle where to submit test execution results.
You could create new TM4J test cycle in your test run setup in order to use its key for test execution results submitting with tm4_api.create_test_cycle function:
from tm4j_reporter_api import tm4j_api
def my_test_run_setup():
tm4j_test_cycle_key = tm4j_api.create_test_cycle(
test_cycle_name="My TM4J test cycle"
)
return tm4j_test_cycle_key
| Param | Mandatory | Description | Type | Example |
|---|---|---|---|---|
| test_cycle_name | Yes | Name of your test cycle | str | My TM4J test cycle |
| description | No | Description of the test cycle outlining the scope | str | Some feature test run |
| planned_start_date | No | Planned start date of the test cycle. Format: yyyy-MM-dd'T'HH:mm:ss'Z' | str | 2020-07-15'T'12:00:00'Z' |
| planned_end_date | No | Planned end date for the test cycle. Format: yyyy-MM-dd'T'HH:mm:ss'Z' | str | 2020-07-15'T'12:30:00'Z' |
| jira_project_version | No | ID of the version from Jira | int | 1000 |
| status_name | No | Name of a status configured for the project | str | Done |
| folder_id | No | ID of a folder to place the test cycle within | int | 10001 |
| owner_id | No | Atlassian Account ID of the owner of the test cycle | str | 377441B7-835D-4B08-B7F4-219E9E62C015 |
Test execution results
With TM4J test cycle key you can now submit test execution result. You also could use test cycle key of already existing TM4J test cycle if you want.
Pass test cycle key and test execution results to tm4j_api.create_test_execution_result function:
from tm4j_reporter_api import tm4j_api
def my_test_teardown(tm4_test_cycle_key, tm4j_test_case_key, execution_status):
tm4j_api.create_test_execution_result(
test_cycle_key=tm4_test_cycle_key,
test_case_key=tm4j_test_case_key,
execution_status=execution_status
)
| Param | Mandatory | Description | Type | Example |
|---|---|---|---|---|
| test_cycle_key | Yes | Key of TM4J test cycle to put test execution to | str | TIS |
| test_case_key | Yes | Key of test case the execution applies to | str | SA-T10 |
| execution_status | Yes | Name of the Test Execution Status | str | Pass |
| test_script_results | No | List of objects with test steps results: statusName (str), actualEndDate (str, yyyy-MM-dd'T'HH:mm:ss'Z'), actualResult (str). Number of objects should match to steps number in TM4J test script. | list | [{"statusName": "Pass", "actualEndDate": "2020-07-15'T'12:30:00'Z'", "actualResult": "This step passed"}, {"statusName": "Fail", "actualEndDate": "2020-07-15'T'12:30:10'Z'", "actualResult": "This step failed"}] |
| actual_end_date | No | Date test was executed. Format: yyyy-MM-dd'T'HH:mm:ss'Z' | str | 2020-07-15'T'12:30:00'Z' |
| environment_name | No | Environment assigned to the test case | str | Staging |
| execution_time | No | Actual execution time in milliseconds | int | 121000 |
| executed_by_id | No | Atlassian Account ID of the user who executes the test | str | 377441B7-835D-4B08-B7F4-219E9E62C015 |
| assigned_to_id | No | Atlassian Account ID of the user assigned to the test | str | 377441B7-835D-4B08-B7F4-219E9E62C015 |
| comment | No | Comment against the overall test execution | str | Test failed on step 2, check with Dev team |
Exceptions
TM4JConfigurationException
Raised by tm4j_api.configure_tm4j_api and tm4j_api.create_test_execution_result functions if tm4j_api.configure_tm4j_api function was not called before:
tm4j_reporter_api.tm4j_exceptions.tm4j_configuration_exceptions.TM4JConfigurationException: You must configure TM4J reporter API before calling TM4J, call tm4j_api.configure_tm4j_api method first
TM4JResponseException
Raised by tm4j_api.configure_tm4j_api and tm4j_api.create_test_execution_result functions if TM4J Cloud responded with response status code different from 201 Created:
tm4j_reporter_api.tm4j_exceptions.tm4j_response_exceptions.TM4JResponseException: Response status code: 400, response message: Bad Request
Metadata
Release files for tm4j-reporter-api 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tm4j-reporter-api-0.1.2.tar.gz | 7.2 kB | Without provenance | Details for tm4j-reporter-api-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tm4j_reporter_api-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for tm4j_reporter_api-0.1.2-py3-none-any.whl |
Total release size: 15.6 kB
Release files / tm4j-reporter-api-0.1.2.tar.gz
| Download URL | tm4j-reporter-api-0.1.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e895f21bfe6f848e77f78ce669563e3c77c930f6954c425013287516f3027bcb
|
|
BLAKE2b-256 checksum How to use checksums |
9f467ba58b984e04a4a9f9e1626fa17bed535053db90966bb62373edd56c988c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / tm4j_reporter_api-0.1.2-py3-none-any.whl
| Download URL | tm4j_reporter_api-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14d1948b5b3d13e872a0d2247ca18946df4f98ab9e7ff50ce6eac09a955f8322
|
|
BLAKE2b-256 checksum How to use checksums |
58f2671b9583bb1f3550facf42f96c57e39e1e28db762c25e22a419ee0f942a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Security for tm4j-reporter-api 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.