【发布时间】:2020-03-18 10:21:48
【问题描述】:
我希望能够为文件中的每个场景定义一组运行规则。最容易放置这些内容的地方是在后台,但他们需要有一个非常类似于场景大纲的示例表。
Feature: Example Feature File
In order to perform as task
As I user
I want this test to work
Background:
Given I have used <data> in my test
Examples:
| data |
| test string |
| test String 2 |
Scenario Outline: Running a test
Given I have prepared the test data
When I run the test
Then The test should pass
任何人都可以想出一种方法来完成这项工作(或类似的东西),因为我已经进行了 200 多个测试并且我有点讨厌将其添加到每个测试中
【问题讨论】:
-
不幸的是,您需要将其放在每个场景中。您不能为背景提供示例数据。
标签: c# .net automation specflow