SpecFlow - How you properly use the "Background:" command in the feature file?

Mastro picture Mastro · Jan 27, 2011 · Viewed 23.5k times · Source

I've been reading articles, watching some screen-casts and playing around with a few sample/demo tutorials.

I read an article where someone said "don't use too many backgrounds". I was curious so I tried it in SpecFlow's feature file and it highlights as a command.

I've been trying to find some language guide for "Gherkin" since that's what it's written for, but no luck yet.

So how is it used? and is there any documentation that will show me what other commands I'm missing and how to use?

Thanks.

Answer

k3b picture k3b · Jan 27, 2011

I've been trying to find some language guide for "Gherkin" ... but no luck yet.

Since SpecFlow is designed after cucumber (a BDD framework for programming language Ruby) it is a good idea to look into the Cucumber wiki if you have questions about Gherkin.

I found this description of "Background"
https://docs.cucumber.io/gherkin/reference/#background