How do I use SpecFlow's “Scenarios” keyword?

前提是你 提交于 2019-12-23 09:15:04

问题


In my feature file, IntelliSense says that there is a keyword called Scenarios. Note that it is plural. I've poured through the documentation and can't find any references to it. Can anybody explain what it is for and how it can be used?


回答1:


That's a synonym to the Examples word used in for different Scenarios using the Scenario Outline construct... Or in plain English; if you use a Scenario Outline you can list the different examples under the keyword "Examples", or under the keyword "Scenarios".

Here is an example:

Scenario Outline: eating
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Scenarios:
    | start | eat | left |
    |  12   |  5  |  7   |
    |  20   |  5  |  15  |

I didn't know that before but it's easy to spot by looking in the language file. Here you'll find all the words in the all the supported languages.



来源:https://stackoverflow.com/questions/8391542/how-do-i-use-specflows-scenarios-keyword

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!