【发布时间】:2019-08-26 10:12:37
【问题描述】:
Scenario Outline 关键字可用于多次运行相同的场景,使用不同的值组合。
当参数为表格时,如何使用 Scenario Outline 简化多个场景。
Scenario: 1 row
Given I import data to a table
| col1 | col2 |
| value1-1 | value1-2 |
When I execuate the logic1
Then I can get data
| result_col1 | result_col2 |
| result-value1-1 | result-value1-2 |
Scenario: 2 rows
Given I import data to a table
| col1 | col2 |
| value1-1 | value1-2 |
| value2-1 | value2-2 |
When I execuate the logic1
Then I can get data
| result_col1 | result_col2 |
| result-value1-1 | result-value1-2 |
Scenario: 3 rows
Given I import data to a table
| col1 | col2 |
| value1-1 | value1-2 |
| value2-1 | value2-2 |
| value3-1 | value3-2 |
When I execuate the logic1
Then I can get data
| result_col1 | result_col2 |
| result-value1-1 | result-value1-2 |
| result-value3-1 | result-value3-2 |
【问题讨论】:
标签: cucumber-java cucumber-junit