Fast steps-defs based on features generation 🍉
You are tired of creating a "steps file"? Me too, so I decided to simplify my problem.
npm install -g yo
npm install -g generator-cucumber-stepsyo cucumber-stepsSelect path to the feature-file (without file extension) and location where will be generated a stepsDefs file. It's simple!
Feature: title
Scenario: title
Given precondition with "1" and "2"
When action
And addition
Then testable outcome equals "1"If you have same feature with parameters, you'll recieve:
const {defineSupportCode} = require('cucumber');
defineSupportCode(function ({Given, When, Then}) {
Given(/^precondition with "(.*)" and "(.*)"$/, function (param1, param2) {
return true;
});
When(/^action$/, function () {
return true;
});
And(/^addition$/, function () {
return true;
});
Then(/^testable outcome equals "(.*)"$/, function (param1) {
return true;
});
});Dictionary in new version of gherkin was changed. Be careful if you write your features with locale support!
For example, in Russian localization, key word Если now refer to Given. Use Когда or synonyms of И.
MIT © lamartire
