Skip to main content

Testrail Api

PyPI Downloads PyPI - Python Version PyPI - Implementation Build Status codecov

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

Install

Install using pip with

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=datetime.now()
)

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 = "screenshots/attach.jpg"
api.attachments.add_attachment_to_result(result["id"], attach)

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

Contributing

Contributions are very welcome.

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.8.1-py2.py3-none-any.whl (15.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file testrail_api-1.8.1-py2.py3-none-any.whl.

File metadata

  • Download URL: testrail_api-1.8.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/50.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for testrail_api-1.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bd4d9c9cdd1eedef93c109ec337013daecb0e8e79987d31352aa799dfa2ef8ce
MD5 c47c33e4e51f794b00f2b8bd84672a84
BLAKE2b-256 731f4cb4e39db2c46cc18329ee4280b40c4ae8338322ee7fb43fe167c0989adf

See more details on using hashes here.

Release history Release notifications | RSS feed

1.13.6

2 files

1.13.5

2 files

1.13.4

2 files

1.13.3

2 files

1.13.2

2 files

1.13.1

2 files

1.13.0

2 files

1.12.1

2 files

1.12.0

1 file

1.11.0

1 file

1.10.6

1 file

1.10.5

1 file

1.10.4

1 file

1.10.3

1 file

1.10.2

1 file

1.10.1

1 file

1.10.0

1 file

1.9.1

1 file

1.9.0

1 file

This release

1.8.1 This release

1 file

1.8.0

1 file

1.7.2

1 file

1.7.1

1 file

1.7.0

1 file

1.6.4

1 file

1.6.3

1 file

1.6.2

1 file

1.6.1

1 file

1.6.0

1 file

1.5.0

1 file

1.4.11

1 file

1.4.6

1 file

1.4.5

1 file

1.4.4

1 file

1.4.3

1 file

1.4.2

1 file

1.4.1

1 file

1.4.0

1 file

1.3.6

1 file

1.3.5

1 file

1.3.0

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.2

1 file

1.0.1

1 file

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page