Sharing example tables between scenarios

前端 未结 2 1146
隐瞒了意图╮
隐瞒了意图╮ 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.

提交回复
热议问题