Sharing example tables between scenarios

前端 未结 2 1145
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 23:29

I have a feature file with 3 scenarios for doing some BDD tests on a C# project. Each scenario is demonstrated using a large examples table (about 40 rows). Example tables a

相关标签:
2条回答
  • 2020-12-12 00:01

    You can use SpecFlow's "background" keyword.

    Background: 
        Given my table looks like
        | .... | .... |
    

    Put this before your scenarios. You can then include the table as you would for any other Given, and it will be available for every scenario in the file.

    0 讨论(0)
  • 2020-12-12 00:17

    No, SpecFlow does not support this.
    See http://dannorth.net/2008/06/30/let-your-examples-flow/ for some clues as to why the feature is not implemented in BDD frameworks.

    0 讨论(0)
提交回复
热议问题