api-testrail
An API wrapper for TestRail with error handling
The TestRail API is described here
Usage
Of cource, you need to setup the API wrapper :
; const testrail = host username password;
Cases
Returns an existing test case
testrail return /*case data*/;
Returns a list of test cases for a project
testrail return /*all cases' data*/;
Returns a list of test cases IDs for a project and case type
testrail return /*list of IDs*/;
Creates a new test case The following POST fields are supported: sectionID(required), title, prioretyID, typeID
testrail return /*added case's data*/;
Updates an existing test case (partial updates are supported, you can update only title, priority and type)
testrail return /*updated case's data*/;
Deletes an existing test case
testrail return /*statusID, i.e. 200*/;
Case Fields
Returns a list of available test case custom fields
testrail return /*case fields' list*/;
Case Types
Returns a list of available case types
testrail return /*case types' list*/;
Milestones
Returns an existing milestone
testrail return /*milestone's data*/;
Returns the list of milestones for a project
testrail return /*list of milestones' data*/;
Creates a new milestone The following POST fields are supported - milestone's name and description
testrail return /*added milestone's data*/;
Updates an existing milestone (partial updates are supported, you can submit and update only - is_completed field)
testrail return /*updated milestone's data*/;
Deletes an existing milestone
testrail return /*statusID, i.e. 200*/;
Plans
Returns an existing test plan
testrail return /*test plan's data*/;
Returns the list of test plans for a project
testrail return /*list of test plans' data*/;
Creates a new test plan The following POST fields are supported - plan's name and description
testrail return /*added test plan's data*/;
Adds new test run to a test plan The following POST fields are supported - planID(required), suiteID(required), name
testrail return /*added test plan entry's data*/;
Updates an existing test plan Following fields are supported - plan's name and description
testrail return /*updated test plan's data*/;
Closes an existing test plan and archives its test runs & results
testrail return /*closed test plan's data*/;
Deletes an existing test plan
testrail return /*statusID, i.e. 200*/;
Configurations
Returns a list of available configurations, grouped by configuration groups
testrail return /*list of configs*/;
Creates a new configuration group
testrail return /*added configGroup data*/;
Creates a new configuration
testrail return /*added config data*/;
Updates an existing configuration group
testrail return /*updated configGroup data*/;
Updates an existing configuration
testrail return /*updated config data*/;
Deletes an existing configuration group and its configurations
testrail return /*statusID, i.e. 200*/;
Deletes an existing configuration
testrail return /*statusID, i.e. 200*/;
Priorities
Returns a list of available priorities
testrail return /*list of priorities*/;
Projects
Returns an existing project
testrail return /*project's data*/;
Returns an existing projects The following filters can be applied: 1 to return completed projects only. 0 to return active projects only
testrail return /*projects' data*/;
Creates a new project (admin status required) The following POST fields are supported: name, announcement, showAnnouncement, suiteMode
testrail return /*added project's data*/;
Updates an existing project (admin status required) Only the following updates are supported - is_completed (true, false)
testrail return /*updated project's data*/;
Deletes an existing project (admin status required)
testrail return /*statusID, i.e. 200*/;
Results
Returns a list of test results for a test
testrail return /*list of test results for a test*/;
Returns a list of test results for a test run (except untested tests)
testrail return /*list of test results for a test run*/;
Returns a status of case
testrail return /*status_id of test case*/;
Adds a new test result and/or comment for a test
testrail return /*added result's data */;
Adds a new test result or comment for a case
testrail return /*added result's data */;
Result Fields
Returns a list of available test result custom fields
testrail return /*list of test result fields*/;
Runs
Returns an existing test run
testrail return /*run's data*/;
Returns a list of test runs for a project. Only returns those test runs that are not part of a test plan The following filters can be applied: 1: 1 to return completed projects only. 0 to return active projects only 2: limit, 3: milestoneID, 4: suiteID
testrail return /*list of runs' data*/;
Creates a new test run
testrail return /*added run's data*/;
Creates a new test run for specific case type and returns run ID
testrail return /*added run's id*/;
Updates an existing test run (partial updates are supported: runName and description)
testrail return /*updated run's data*/;
Closes an existing test run and archives its tests & results
testrail return /*closed run's data*/;
Deletes an existing test run
testrail return /*statusID, i.e. 200*/;
Sections
Returns an existing section
testrail return /*section's data*/;
Returns a list of sections for a project and test suite The ID of the test suite (optional if the project is operating in single suite mode, default is 1)
testrail return /*lits of section's data*/;
Creates a new section The ID of the test suite is optional (default is 1) if the project is operating in single suite mode, required otherwise)
testrail return /*added section's data*/;
Updates an existing section (partial updates are supported, i.e. you can submit and update specific fields only)
testrail return /*updated section's data*/;
Deletes an existing section
testrail return /*statusID, i.e. 200*/;
Statuses
Returns a list of available test statuses
testrail return /*statuses list*/;
Suites
Returns an existing test suite
testrail return /*suite's data*/;
Returns a list of test suites for a project
testrail return /*list of test suite's*/;
Creates a new test suite
testrail return /*added test suite's data*/;
Updates an existing test suite
testrail return /*updated test suite's data*/;
Deletes an existing test suite
testrail return /*statusID, i.e. 200*/;
Templates
Returns a list of available templates
testrail return /*list of templates*/;
Tests
Returns an existing test
testrail return /*test's data*/;
Return all tests for a test run Optional: Also a comma-separated list of status IDs to filter by
testrail return /*tests data*/;
Users
Returns an existing user
testrail return /*user's data*/;
Returns a list of users
testrail return /*list of users*/;
Returns an existing user by his/her email address
testrail return /*user's data*/;
FYI
STATUS_IDs
Passed - 1Blocked - 2Untested - 3Retested - 4Failed - 5
TYPE_IDs
Acceptance - 1Accessibility - 2Automated - 3Compatibility - 4Destructive - 5Functional - 6 - 7Performance - 8Regression - 9Security - 10Smoke & Sanity - 11Usability - 12