Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

specflow generate step definitions missing from context menu

Tags:

specflow

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.

like image 693
MonkeyBonkey Avatar asked Jun 07 '16 15:06

MonkeyBonkey


2 Answers

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
like image 162
rgb Avatar answered Sep 22 '22 08:09

rgb


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:

enter image description here

And here it is once I do:

enter image description here

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.

like image 26
RyanfaeScotland Avatar answered Sep 20 '22 08:09

RyanfaeScotland