A WebdriverIO plugin to generate cucumber step definitions snippets to paste in your code.
Run a test. It automaticly reports you the snippet output when steps are not specified. Copy and paste the snippet in your step definitions file. When ready with your step remove the line "return 'pending'" and off you go!
The easiest way is to keep wdio-cucumber-snippet-reporter
as a devDependency in your package.json
.
{
"devDependencies": {
"wdio-cucumber-snippet-reporter": "~0.0.5"
}
}
You can simple do it by:
npm i wdio-cucumber-snippet-reporter -D
Following code shows the default wdio test runner configuration. Just add 'cucumber-snippet'
as reporter
to the array.
To make it work, the parameter value of: ignoreUndefinedDefinitions in cucumberOpts must be set to true.
// wdio.conf.js
module.exports = {
// ...
reporters: ['dot', 'spec', 'cucumber-snippet'],
// ...
cucumberOpts: {
// ...
ignoreUndefinedDefinitions: true,
// ...
}
};
All commands can be found in the package.json. The most important are:
Watch changes:
$ npm run watch
Run tests:
$ npm test
# run test with coverage report:
$ npm run test:cover
Build package:
$ npm run build