How do I disable a feature in specflow (Gherkin) without deleting the feature?
I have some SpecFlow features (using the Gherkin syntax) and I would like to temporarily disable the feature to prevent its tests from running?
Is there an attribute I can mark the feature with to do this? I'm guessing that something that works with Cucumber might also work with SpecFlow.
You can mark the feature with the tag @ignore:
@ignore @web
Scenario: Title should be matched
When I perform a simple search on 'Domain'
Then the book list should exactly contain book 'Domain Driven Design'
In the recent version of Specflow, you now also have to provide a reason with the tag, like so:
@ignore("reason for ignoring")
EDIT: For some reason it break with spaces but this works:
@ignore("reason")
As jbandi suggests you can use the @ignore tag.
Tag can be applied to:
- a single Scenario
- a full Feature
Given NUnit as the test provider, the result in generated code is the insertion of the
[NUnit.Framework.IgnoreAttribute()]
to the method or the class.