Reputation: 21
Is there any way to programmatically list all cucumber scenarios? Something like
Cucumber.scenarios would be great.
I am trying to build a tool on top of cucumber and listing scenarios is very important. The alternative is to run all scenarios, grab each scenario in the after hook and store somewhere.
Upvotes: 2
Views: 1377
Reputation: 22296
To list the scenarios in Cucumber you can use the -d
switch on command line.
Also you can combine with -f
for specifying the output format.
If you want integrate the loading and parsing the .feature files you will need to take a look at the source code of cucumber and try to replicate when you cannot use the implementation.
Since this is a "custom" implementation and you don't provide any code, this is the far as I can go to help you.
Upvotes: 1