The format of the feature files used in Cucumber or SpecFlow is very simple. The format (or grammar), called Gherkin, was intentionally designed to be simple, so that the specification written in these files are kept simple and understandable. There are no loops or ifs. The only special structure you can make in a feature file is the “Background” section. In the background section you can list one or more given steps that will be implicitly included in every scenario of the file. So you can use it to extract common preconditions from the scenarios to avoid duplication. Sounds simple, but still, half of the BDD practitioners like and use this feature, while the other half doesn’t. Where do you belong to? Here is a list of pros and cons.
SpecFlow tips: Feature file backgrounds — like them or not
by Gáspár on February 11, 2016
