2016-04-28 3 views
0

私はこのキュウリ - 同じテンプレート内の複数のシナリオでフィーチャファイルを実行するにはどうすればいいですか?

特集のような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 

foreachの時間が、私はこのキュウリテストケースを実行し、propblemをスリップ。すべてのステップ:

@Given("^we use employee with name \"([^\"]*)\"$") 
public void we_use_employee_with_name(String employeeName) { 
} 

は2回実行されます。 2つのシナリオの2つのステップと一致しているため、

シナリオ別にテストシナリオを実行し、ステップバイステップをアップダウンする方法はありますか?

おかげ

答えて

1

のベストプラクティスが機能して、シナリオのためのタグを使用して、例えばランナークラスを使用してそれらを実行することです:TAG1 シナリオ@

: はTAG2 @

ステップ シナリオ: 手順を

また、もう少し説明することができれば、発行については素晴らしいでしょう

+0

フィードバックいただきありがとうございます、私はすでに私の問題を解決しました。 @ Ranjithさんの –

+0

@Ducあなたが解決したら、ここにご記入ください.. – csf

関連する問題