【发布时间】:2017-08-07 20:44:18
【问题描述】:
我有4个场景,例如:
Scenario: test single unit transaction
Given Scene is set
When We did something
Then
| header1 | unit | etc. |
| data1 | data2 | ... |
Scenario: test multiple unit transaction
Given Scene is set
When We did something
Then
| header1 | unit | etc. |
| data1 | data2 | ... |
| data3 | data4 | ... |
Scenario: test single percentage transaction
Given Scene is set
When We did something
Then
| header1 | percentage | etc. |
| data1 | data2 | ... |
Scenario: test multiple percentage transaction
Given Scene is set
When We did something
Then
| header1 | percentage | etc. |
| data1 | data2 | ... |
| data3 | data4 | ... |
它们更复杂更长,所以我想实现这样的目标:
Scenario Outline: test transactions
Given Scene is set
When We did something
Then
| header1 | unit | etc. |
| <data1> | <data2> | ... |
Examples: single transaction
| header1 | unit | etc. |
| data1 | data2 | ... |
Examples: multiple transaction
| header1 | unit | etc. |
| data1 | data2 | ... | --------> these should run together in one test
| data3 | data4 | ... | -------->
对于其他类型的交易也是如此。
不幸的是,Cucumber 一直将上述情况作为 3 个不同的场景运行,而不是 2 个,而第二个场景有 2 个事务。 有谁知道如何使它工作?
非常感谢。
【问题讨论】:
-
您使用的是什么版本的 Cucumber,您的脚本使用什么语言? @monami
-
不幸的是,它是黄瓜 1.2.2,我使用 Java(也添加到标签中)
-
@DanielFintinariu 编辑将删除我在代码中的粗体文本
-
功能文件中不需要 :)
-
是的,它是为了强调那些部分
标签: java cucumber bdd scenarios