Skip to main content

Python wrapper of the TestRail API

Project description

PyPI Downloads PyPI - Python Version PyPI - Python Version

This is a Python wrapper of the TestRail API(v2) according to the official documentation

Install

pip install testrail-api

Support environment variables

  • TESTRAIL_URL

  • TESTRAIL_EMAIL

  • TESTRAIL_PASSWORD

Example

from datetime import datetime

from testrail_api import TestRailAPI

api = TestRailAPI('https://example.testrail.com/', 'example@mail.com', 'password')

# if use environment variables
api = TestRailAPI()


new_milestone = api.milestones.add_milestone(
    project_id=1,
    name='New milestone',
    start_on=int(datetime.now().timestamp())
)

my_test_run = api.runs.add_run(
    project_id=1,
    suite_id=2,
    name='My test run',
    include_all=True,
    milestone_id=new_milestone['id']
)

result = api.results.add_result_for_case(
    run_id=my_test_run['id'],
    case_id=5,
    status_id=1,
    comment='Pass',
    version='1'
)
attach = './attach.jpg'
api.attachments.add_attachment_to_result(result[0]['id'], attach)

api.runs.close_run(my_test_run['id'])
api.milestones.update_milestone(new_milestone['id'], is_completed=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testrail_api-1.4.6-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file testrail_api-1.4.6-py3-none-any.whl.

File metadata

  • Download URL: testrail_api-1.4.6-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for testrail_api-1.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6793234a916e5d0a07b59c1fd3f987ae2a1135b22e1e8f3ed9cb8fa08b4ac390
MD5 92b6d75842d11c4e1cb228bb185d7bb0
BLAKE2b-256 752f66308634e7e4748a755308a6a28de4a7d824c8b7b8f98990dc049a577b6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page