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

后端 未结 4 1949
暗喜
暗喜 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:47

    This question has been previously answered correctly above.

    I just came across the same error "No matching step definition found for one or more steps".

    The reason that I had this issue, was that I had forgotten to put the attribute [Binding, Scope(Feature = "My Feature")] just above my steps c# code class which links methods to feature file, which is needed to match "Feature: My Feature" at the top of my feature file.

    I just taught that I would document it here to help someone else that was seeing the same error but for the different reason that I outlined.

提交回复
热议问题