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

前端 未结 4 906
庸人自扰
庸人自扰 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:19

    If I understand the question correctly, you want to call other scenarios across different feature files.

    1. You can handle this by creating a step which would call the steps in the scenario (basically nested steps like the accepted answer above).
    2. Add the created step to the Background

    or

    1. Create a function which would call the steps in the scenario.
    2. Add a tag @create_sale_order to the scenarios that needs a sale order as precondition.
    3. Implement a before scenario hook for the tag @create_sale_order and call the function created at step 1.

提交回复
热议问题