更新答案!!
正如@kayle 在他的回答中提到的那样。您可以编写以下测试场景
Scenario Outline: Hello World
Given I am logged in as <user>
When I search for <searchTerm>
Then I add the following to my basket:
| Teapot |
| Yorkshire tea |
Examples:
| user | searchTerm |
| Adam | Tea |
或者
Scenario Outline: Hello World
Given I am logged in as <user>
When I search for <searchTerm>
Then I add the following to my basket:
| <item1> |
| <item2> |
Examples:
| user | searchTerm | item1 | item2 |
| Adam | Tea | Teapot| Yorkshire tea|
如果您想为每个用户添加不同的项目,第二种情况将很有用。例如:
Scenario Outline: Hello World
Given I am logged in as <user>
When I search for <searchTerm>
Then I add the following to my basket:
| <item1> |
| <item2> |
Examples:
| user | searchTerm | item1 | item2 |
| Adam | Tea | Yorkshire tea | Teapot |
| Tom | Books | book1 | book2 |
希望清楚!!