Each project should have its own Test Plan, with each features having their own Test Run.
To get started, create the .testrail-sync.js
file at the root of your project :
module.exports = {
testrail: {
host: 'https://YOURACCOUNT.testrail.com',
user: '',
password: '', // password or api key
filters: {
plan_id: '', // required: the project's plan id
run_id: '', // optional: a test run
// if not set, all the runs in the plan will be included
custom_status: [3, 4] // optional list of whitelisted status (testcases that don't have 1 of thoses statuses won't be synced)
// 3 = Approved
// 4 = Approved to automate
}
},
/* Optional: default testcase attributes when pushing new testcases to TestRail
newTestCase: {
section_id: 1,
template_id: 1,
type_id: 6,
priority_id: 2,
estimate: '0',
custom_status: 4
}
*/
};
There are other possible options:
- overwrite: Toggle the local .feature file overwrite OR remote test case overwrite if the local Gherkin doesn't match the Gherkin from TestRail.
overwrite: {
local: 'ask', // 'ask' will show you the differences and force you to confirm before overwriting
remote: false,
}
-
stepDefinitionsTemplate: The template to use to generate blank step definition files - Possible values:
-
for cucumber-js >= 2.x:
es5.js
,es6.js
,typescript.ts
-
for cucumber-js 1.x:
es5.legacy.js
,es6.legacy.js
,typescript.legacy.ts
-
other:
ruby.rb
-
-
indent: The indentation character(s) to use when generating
.feature
or.js
files (ie.indent: ' '
, default: 2 spaces) -
featuresDir: The directory where
.feature
files should be created (default:features
) -
stepDefinitionsDir: The directory where blank step definition files should be created (default:
features/step_definitions
) -
stepDefinitionsStringPatterns: (cucumber-js 1.x only) If set to
true
, Strings patterns will be used instead of regexps to write step definition files. -
stepDefinitionsExpressions: (cucumber-js >= 2.x only) If set to
true
, Cucumber expressions will be used instead of regexps to write step definition files. -
directoryStructure: Used to match the TestRail sections tree with the local tests directory structure.
-
type: The variable name to used to create the folders - Possible values:
section:slug
orsection:name
-
skipRootFolder: The number of TestRail root sections to skip when creating the local tests directory structure.
-