多个场景是否可以使用同一个示例表?
所以而不是像下面这样:
Scenario Outline: First Scenario
Given I am viewing "<url>"
Then I assert that the current URL "<url>"
Examples:
| url |
| https://google.com |
| https://twitter.com|
Scenario Outline: Second Scenario
Given I am viewing "<url>" with route "</contactus>"
Then I assert that "<url>" contains "contactus"
Examples:
| url |
| https://google.com |
| https://twitter.com|
我可以做类似的事情
Scenario Outline: Reusable Example
Examples:
| url |
| https://google.com |
| https://twitter.com|
Scenario: First Scenario
Given I am viewing "<url>"
Then I assert that the current URL "<url>"
Scenario: Second Scenario
Given I am viewing "<url>" with route "</contactus>"
Then I assert that "<url>" contains "contactus"
我在 StackOverflow 上发现了一个类似的问题,但是在一个场景中合并我的所有场景对我来说不是一个选择。由于这个问题是在 2014 年发布的,也许框架中有一些我不知道的进步:D
先感谢您。