wdio-testrail-service
v0.2.4
Published
WebdriverIO service for selecting test cases from TestRail
Downloads
4
Maintainers
Readme
wdio-testrail-service
With this plugin for webdriver.io you can choose test cases to execute based on Priority and Automation Status in TestRail.
Currently, the service only works with mocha test framework and assumes the TestRail Case ID is included in your mocha describe
or it
(or suite
, test
for TDD) blocks.
Installation
The easiest way to install this module as a (dev-)dependency is by using the following command:
npm install wdio-testrail-service --save
Or:
npm install wdio-testrail-service --save-dev
Usage
Add wdio-testrail-service and required options to your wdio.conf.js
:
exports.config = {
// ...
services: [
[
"testrail",
{
testrailServer: {
domain: "https://xxxx.testrail.io",
username: "TestRailUsername",
apiToken: "TestRailAPIToken",
},
projects: ["Web Application"],
suites: ["Smoke Tests", "Regression Tests"],
priorities: ["Critical", "High"],
},
],
],
// ...
};
Options
testrailServer (required)
Object containing information required to connect to your TestRail instance:
- domain: "https://xxxx.testrail.io"
- username: "TestRailUsername"
- apiToken: "TestRailAPIToken"
projects (required)
Array of Project Names to choose tests from.
suites (required)
Array of Suite Names to choose tests from.
priorities (required)
Array of Priority Names to choose tests from. Use the short name (also called Abbreviation in TestRail).
Notes
The service assume you have a custom Dropdown or Multi-select case field named
automation
with an option namedAutomated
. With this case field, any case not marked asAutomated
will be excluded from running.The service considers cucumber-like tagging. For example, supplying
mocha-opts.grep "@sanity @smoke"
will only include test cases with either@sanity
or@smoke
in the describe or it blocks in addition to filtering by Priority and Automated status.Specifying
mochaOpts.grep
without a tag (no@
in the string) or specifyingmochaOpts.invert
will override this service completely.If you enter invalid Priorities, all Priorities will be included.
For more information on WebdriverIO see the homepage.