Specflow calling steps within steps causes “No matching step definition” error

后端 未结 4 1862
暗喜
暗喜 2021-01-17 17:18

I am following the technique outlined here

using a step defined like

[Given(\"some base scenario has happened\")]
public void SomeBaseScenarioHasHapp         


        
4条回答
  •  臣服心动
    2021-01-17 17:50

    Possible solutions

    Use Given instead of And

    Scenario: Some dependant scenario
    Given some base scenario has happened
    Given some other condition   
    When some other action
    Then some other result
    

    or

    Tag the step with more than one binding, e.g.

    [Given(@"some other condition")]
    [When(@"some other condition")]
    public void Whensome other condition()
    {
    

    but this won't always make semantic sense, so use this only when it really does make sense.

提交回复
热议问题