I'm interested in the question - is there any mechanism to automatically generate the step definitions files based on the feature files? I found a solution for the .Net - this is plugin for Visual Studio - specflow (see section "Generating Step Definitions") . Perhaps there is a similar solution for JavaScript or Typescript?
Asked
Active
Viewed 1,847 times
2
-
Webstorm provides pretty much the same functionality for cucumber js as VS provides for specflow, since this is anyway an IDE question. – joniba Feb 11 '17 at 07:29
1 Answers
-1
Just execute the feature file from command prompt.
The command may look like this:
node index.js -s .\step-definitions -f .\features\featurefileName.feature
And you will get the step definition for undefined steps

Gaurav Lad
- 1,788
- 1
- 16
- 30
-
I've done it. But step definitions are output into console. It is not very useful. I would like get automatic generated file (js or ts). – Ruslan Borovok Feb 10 '17 at 11:16
-
You need to define what action you want to perform in step definition, it will just provide the syntax of how you can write the missing step definition. Machine can not understand what action you want to perform based on your feature file, you need to write that action code by user self, it cant be auto generated – Gaurav Lad Feb 10 '17 at 11:22
-
Correct, but I have another question. I would like get the automatically generated step definitions files without implementation but with automatically generated function names like in example - http://imgur.com/a/HwMdC – Ruslan Borovok Feb 10 '17 at 11:30