rs7*_*s79 3 java cucumber cucumber-jvm
我们希望在Java测试自动化框架中使用Cucumber更好地管理测试数据.对于a Scenario Outline,我们希望将按其运行的适用环境分类的测试参数列表.例如,
Scenario Outline: Login into application
Given I am on the homepage in the <environment>
When I enter my <user>
And I enter my <pass>
Then I am taken to the homepage
Examples:
|user |pass |environment|
|test |test1 |local |
|retest |retest1 |sit |
|prodtest|prodtest1|production |
Run Code Online (Sandbox Code Playgroud)
因此,当上述场景在例如SIT环境中执行时,将仅拾取第二个示例,而不是第一个和第三个示例.
这个执行级别可以完成吗?
您可以通过将示例表拆分为两个并在其上使用标记来完成此操作...然后使用标记运行测试以过滤黄瓜选项.
@others
Examples:
|user |pass |environment|
|test |test1 |local |
|prodtest|prodtest1|production |
@sit
Examples:
|user |pass |environment|
|retest |retest1 |sit |
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1282 次 |
| 最近记录: |