In Specflow can I run one test as a step of another?

前端 未结 4 870
庸人自扰
庸人自扰 2020-12-06 05:25

TL;DR; How can I create a specflow test that calls another test as its first step?

Given I already have one specflow test
And I want to run          


        
4条回答
  •  自闭症患者
    2020-12-06 06:18

    Use a Background:

    Background:
        Given I want to create a sales order
        And I open the sales order page
        And I click the add new order button
        Then a new sales order is created
    
    Scenario: I add another sale
        When I add a sales order line
        Then the order total is updated
    
    Scenario: I add cancel a sale
        When I cancel a sale
        Then the order total is updated to 0
    
    etc.
    

提交回复
热议问题