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 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
run - get by run id, add, close, delete, update
status - get by status id, get by label (with strict casing filter)
statuses - get all
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 - get by case id, 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
runs - get by project or project id
section - get by section id, add, delete, update
sections - get by project or project id (* and suite or suite id)
- 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.13-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cde32e669b036905e46ac5a2acb1c615aa0b3250b9b2f2f43ec9fd37d799920 |
|
MD5 | de05df4e0133863768e3815e98b616ab |
|
BLAKE2b-256 | 80a6f6fbda08131cebcce97f698ac9b1aebe702d523ae7437784333169725244 |