In SpecFlow how can I share data between steps/features?

前端 未结 6 709
情深已故
情深已故 2020-12-05 01:54

I have 2 features that use a common \'When\' step but have different \'Then\' steps in different classes.

How do I access, for example, the ActionResult from my MVC

6条回答
  •  囚心锁ツ
    2020-12-05 02:51

    You can define a parameter in your steps that is the key to the value you are storing. This way you can reference it in your later steps by using the key.

    ...
    Then I remember the ticket number ''
    ....
    When I type my ticket number '' into the search box
    Then I should see my ticket number '' in the results 
    

    You could store the actual value in a dictionary or property bag or similar.

提交回复
热议问题