I followed the getting started instructions and the "generate step definitions" is missing from context menu.
I tried adding the additional specflow packages from nuget for mstest and still nothing.
I had the same problem. I was looking for this option in contextual menu of the feature file, but this option exists in the contextual menu of the content of the feature file. So, try open the feature file (*.feature) in the Visual Studio text editor and click right button of the mouse inside text editor. Example of the file:
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have entered 70 into the calculator
When I press add
Then the result should be 120 on the screen
Assuming you are bringing up the correct context menu by right clicking in the .feature file as opposed to anywhere else then you may find that the issue is actually caused by the TechTalk.SpecFlow.dll not being referenced in your project.
To add the reference manually (NuGet didn't do it for me) right-click on the References folder of your project and find the TechTalk.SpecFlow.dll which will likely be in '[project]/packages/SpecFlow.X.X.X/lib/netXX/' (X's are version numbers).
Here is the context menu when I don't have the correct reference in place:
And here it is once I do:
This was SpecFlow.2.1.0 and VS2010 which led me to another issue with incompatible .Net versions so I ended up using SpecFlow.1.9.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With