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)
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 test or test id, 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.12-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b11a970a32dbba2ae5dcb7ac8b46fbdcc3756cff9c28311a4a0e791d6a432471 |
|
MD5 | 1b87f520584ac5358675b54d7a90263a |
|
BLAKE2b-256 | 6838a527937f52cc99f6f344231f1f05146712a59b1ec88f75bb1152a6a24e15 |