TestRail API reporter tools
Project description
TestRail reporter
This is Testrail API reporter tools.
This package contains several tools to interact with TestRail via API.
General part is TestRailResultsReporter which is designed to report test results via api. This part is close to trcli, but without nasty bugs.
Firstly, you need to obtain test results in xml format. You can do it via running your testsuite, i.e. using pytest:
pytest --junitxml "junit-report.xml" "./tests"
Also you need to add custom field (string type) to TestRails with name automation_id
.
Now, you ready to upload results to TestRails. To it, use:
url=https://your_tr.testrail.io`
email=your@email.com
password=your_password
project_number=42
test_suite_number=66
api=TestRailResultsReporter(url=url, email=email, password=password, project_id=project_id, suite_id=test_suite_id, xml_report='junit-report.xml')
# then just call:
api.send_results()
After this new testcases, test run and test results will be created. Testrun will have a name like AT run 2022-09-01T20:25:51
If you fill automation_id
for existing testcases using correct format path.to.testfile.filename.test_class.test_step
, then in such case results will be added to existing testcases.
Also, you can customize test run by passing:
title
param to send_results function - it will replace whole test run title.environment
- it will be added to end of string likeAT run 2022-09-01T20:25:51 on Dev
timestamp
- it will replace timestamp, obtained from XML file)run_id
- if specified, results will be added to test run, no new testrun will be createdclose_run
- may beTrue
(by default) orFalse
- ifTrue
, then every testrun will be closedrun_name
- you may use run name (title) instead of it's ID, in this case run id will be ignored even if it's filleddelete_old_run
- may beTrue
orFalse
(by default) - ifTrue
, then specified testrun will be deleted and new one will be created
Also, you can setup other params separately without need to re-initialize api object:
set_project_id(project_id)
- change project id
def set_suite_id(suite_id)
- change suite id
def set_xml_filename(xml_filename):
- change path/filename of xml report
set_at_report_section(section_name)
- change default folder name where non-linked testcases will be created
set_timestamp(new_timestamp)
- change default timestamp to custom
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for testrail_api_reporter-0.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e23eebae8966b95e02a444779832c41687ac6c690bc5489ab9c74de9e542905 |
|
MD5 | 298fa7c59fdcac2600642435d8c0dc04 |
|
BLAKE2b-256 | a0d721e6dfe0bcea3b101509fd2aceb585922a6bb52d7e90b3dcbe9ddc58c1db |
Hashes for testrail_api_reporter-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fda6e27aa9c45c99212ecd96206b6e83db3afa15909b9a620e6e4ff8eb33eba0 |
|
MD5 | 668febba56ddba32d6df4fa8a61114e2 |
|
BLAKE2b-256 | edceff9882f63c8466a7294a28bef3425617d05c01147594a48798383608d810 |