Skip to main content

Python wrapper of the TestRail API

Project description

PyPI Downloads PyPI - Python Version

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

Install

pip install testrail-api

Example

from datetime import datetime
from pathlib import Path

from testrail_api import TestRailAPI

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

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 = Path('.', '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.3.6-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: testrail_api-1.3.6-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for testrail_api-1.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 37daac20a6db7816615a62ab0e218f96c59f03beb6ff3046693f388b0307bce8
MD5 94831839acd27c1699f14fb60a382fd9
BLAKE2b-256 fbca60226c5ce07ad80587ad871dc3001d83fb5d34fee370cb174fd3a96881ca

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