TestRail API Wrapper
Project description
Note that this project is currently in alpha: APIs can and will change without warning
TRAW is availiable on PyPI and can be pip installed
$ pip install traw
Using TRAW:
import traw
# Instantiate the TRAW client
# Note that you can use also specify credentials using environment vars
# or a configuration file
client = traw.Client(username='<username>', password='<password>', url='<url')
# Locate the target project by project ID
automation_project = client.project(15) # This makes a call to the TestRail API and returns
# project with ID 15
# Add a new suite to this project
# Only Projects configured for multi suite mode can have new suites added
assert automation_project.suite_mode == 3
# First create a new suite object
new_suite = client.suite() # Parameterless calls to most non-plural client methods will return a
# new instance of that type. A new Suite instance in this case.
# The suite name and description and associated project must be set
new_suite.name = "My new Automation suite"
new_suite.description = "This new suite was added via the TRAW client"
new_suite.project = automation_project
# Note that new_suite doesn't have an ID, as it hasn't been added to TestRail yet
assert new_suite.id is None
# Use the client to add the suite to testrail
suite = client.add(new_suite) # TRAW returns an updated Suite instance with additional parameters
# that were returned from TestRail after the suite was added
# Now our suite matches new_suite, but has an ID
assert suit.name == new_suite.name
assert suite.description == new_suite.description
assert suite.id is not None
Additional, more comprehensive examples are available in the examples folder.
Currently supported endpoints:
case - get by case id
case type - get by case type id
case types - get all
configs - get by project or project id, add, delete, update
config groups - add, delete, update
milestone - get by milestone id, add, delete, update
milestones - get all by project or project id
priority - get by priority id
priorities - get all
project - get by project id, add, delete, udpate
projects - get all (with active_only and completed_only filter)
results - get by test or test id (with limit and with_status filters)
run - get by run id, add, close, delete, update
runs - get by project or project id (with created after/before, created by, is completed, limit, milestone, and suite filters)
status - get by status id, get by label (with strict casing filter)
statuses - get all
section - get by section id, add, delete, update
sections - get by project or project id (optionally by suite or suite id)
suite - get by suite id
suites - get by project or project id
templates - get by project or project id
test - get by test id
tests - get by run or run id (both support with_status filter)
user - get by user id or user email
users - get all
Not yet supported:
case - add, delete, update
cases - get by project or project id (* plus suite and section)
case fields - get all
plan - get by plan id, add, close, delete, update
plan entry - add, delete, update
plans - get by project or project id
result - add by test id, add by run and case
results - get by run or run id, get by run and case, get by run id and case id, add by run, add by cases
result fields - get all
- Note: * Denotes endpoint variations dependent on if the project is or is not
operating in single suite mode
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 traw-0.0.14-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06922f57729d6005007bc2dc7650a0d6e88c1d5551959387c0322f7e1a55ee05 |
|
MD5 | 000f60d30144fefe829660cdf87dc6f1 |
|
BLAKE2b-256 | 894045c46c6f8fd830953437fa46f44d7b7a1951474804db6e02cbc626949e97 |