【发布时间】:2016-04-28 08:09:13
【问题描述】:
我有 1 个这样的功能文件
功能:Swissdec 工资单
Scenario Outline:
Given Payslips based on the swissdec example salary item types (and formulas).
Scenario: SwissdecPaySlips01: the employee is in working age and get correct payslip with AHV_DEDUCTION
Given we use employee with name "Peter Bosshard"
And Company with name "Muster AG"
And Monthly salary of CHF 100000.00
And Salary Item Type is attached: 1000, 5000, 9010, 5010
When the payslip for 04.2016 is requested
Then we get a payslip with the following items
| 1000 | MONTHLY_SALARY | 100000.00 |
| 5000 | GROSS_SALARY | 100000.00 |
| 9010 | AHV_BASIS | 100000.00 |
| 5010 | AHV_DEDDUCTION | -5125.00 |
And a period from 2016.04.01 to 2016.04.30
Scenario: SwissdecPaySlips02: the employee is in working age and get correct payslip with AHV_DEDUCTION
Given we use employee with name "Hoang Nguyen"
And Company with name "Axon Active"
And Monthly salary of CHF 100000.00
And Salary Item Type is attached: 1000, 5000, 9010, 5010
When the payslip for 04.2016 is requested
Then we get a payslip with the following items
| 1000 | MONTHLY_SALARY | 100000.00 |
| 5000 | GROSS_SALARY | 100000.00 |
| 9010 | AHV_BASIS | 100000.00 |
| 5010 | AHV_DEDDUCTION | -5125.00 |
And a period from 2016.04.01 to 2016.04.30
问题是,每次我运行这个黄瓜测试用例。每一步:
@Given("^we use employee with name \"([^\"]*)\"$")
public void we_use_employee_with_name(String employeeName) {
}
将运行 2 次。因为它与2个场景中的2个步骤相匹配
如何按场景和逐步从上到下运行测试场景?
谢谢
【问题讨论】:
标签: testng cucumber-jvm