2017-07-25 90 views
0

在我的應用程序中,「估計」和「發票」的測試集非常相似。我可以使用場景大綱和示例來重複使用這些類型的測試。但是,我如何重複所有這個測試中的特性的例子,而不是在每個場景大綱中重複例子?是否有功能大綱?

例如,有沒有一種方法可以重寫下面的測試,而不需要兩次使用狀態示例?

Scenario Outline: Adding a sales line item 
    Given I have a <Transaction> 
    And Add Hours of quantity 2 and rate 3 
    When I save 
    Then the total is 6 
Examples: 
    | Transaction | 
    | Invoice  | 
    | Estimate  | 

Scenario Outline: Adding two sales line item 
    Given I have a <Transaction> 
    And Add Hours of quantity 2 and rate 3 
    And Add Hours of quantity 5 and rate 2 
    When I save 
    Then the total is 16  
Examples: 
    | Transaction | 
    | Invoice  | 
    | Estimate  | 

換句話說,有沒有這樣的事情叫做缺乏更好的特徵大綱?

回答

0

不幸的是,小黃瓜語言不支持這樣的東西