.net SpecFlow - 您如何正确使用功能文件中的“背景:”命令?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4812405/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SpecFlow - How you properly use the "Background:" command in the feature file?
提问by Mastro
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.
我读过一篇文章,有人说“不要使用太多背景”。我很好奇,所以我在 SpecFlow 的功能文件中尝试了它,它突出显示为一个命令。
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.
谢谢。
回答by k3b
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.
由于 SpecFlow 是在 Cucumber(一种用于编程语言 Ruby 的 BDD 框架)之后设计的,因此如果您对 Gherkin 有任何疑问,最好查看 Cucumber wiki。
I found this description of "Background"
https://docs.cucumber.io/gherkin/reference/#background
我找到了“背景”的描述
https://docs.cucumber.io/gherkin/reference/#background

