Reputation: 40489
I want to disable certain scenarios in my Cucumber.js feature files because even though steps are implemented (reused from other scenarios), the code will fail under these circumstances because the feature is not yet implemented.
However, I don't want to use the @ignore
tag on these scenarios as they then aren't seen in the output report and the team forget about them.
What's the best way to do this without explicitly adding a dummy "Given this is not yet implemented" step to each of the new scenarios?
Upvotes: 1
Views: 1964
Reputation: 1214
Your above answer is the best way I can see to do it and is actually the way that the cucumber-js team recommend doing so as seen in https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/hooks.md#skipping-in-a-before-hook
They give two available statuses to use from as seen in https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/step_definitions.md#pending-steps
Upvotes: 1
Reputation: 40489
Here's one idea I had, but it's not built-in to the framework itself. I'm just exploiting the feature of a Before
step which only runs for certain tags
Before({ tags: "@TODO" }, function() {
return "pending";
});
Not sure if there's a more framework-centric way to do it?
Upvotes: 2