Search code examples
c#specflow

SpecFlow error: One or more step definitions are not implemented yet


When I run the unit tests, I'm getting:

One or more step definitions are not implemented yet.
      SpecFlowFeature1Steps.GivenIHaveEnteredIntoTheCalculator(50)Given I have entered 50 into the calculator

Solution

  • I had to remove ScenarioContext.Current.Pending(); from all the methods:

        [Given(@"I have entered (.*) into the calculator")]
        public void GivenIHaveEnteredIntoTheCalculator(int p0)
        {
            ScenarioContext.Current.Pending(); // remove this
        }
    

    I didn't realize it was causing the error and I thought it was because of missing step definitions.

    Anyway, leaving this in case anyone encounters the same error in the future.