Skip to content
This repository was archived by the owner on May 21, 2022. It is now read-only.
/ testrail-api Public archive
forked from tolstislon/testrail-api

Python wrapper of the TestRail API(v2)

License

Notifications You must be signed in to change notification settings

sshink/testrail-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testrail Api

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

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/", "[email protected]", "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["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.

About

Python wrapper of the TestRail API(v2)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%