Is it possible to \"force\" regenerate step definitions for a specflow feature file? I have created this feature file but cannot generate all steps. Am getting a message that al
Right-click the .feature file and chose "Run Custom Tool". That will rerun the SpecFlowSingleFileGenerator that generates the code-behind in the test framework of your choice.
You can regenerate all feature file test classes using the SpecFlow-provided tool specflow.exe.
Assuming that SpecFlow has been installed through NuGet and is in the ./packages
directory relative to your current directory, you can run, in the terminal, the command
.\packages\SpecFlow.X.Y.Z\tools\specflow.exe generateall path\to\myfile.csproj
which will regenerate all feature file unit tests. As the linked page states, you can add the /force
flag to force regeneration of all tests.
Restarting VS is cumbersome especially if you have big project.
We changed code of specflow plugin (https://github.com/techtalk/SpecFlow). Added command that reinitializes scope (refer to method EnsureInitialization) and cleans chached file.
Now we just click on button when bindings are changed.
If you've been having problems with Specflow bindings such as:
and restarting Visual Studio or regenerating the bindings doesn't work, then the SpecFlow Troubleshooting Visual Studio Integration has various solutions for Visual Studio 2013 and 2015.
Another one to check that fooled me is have you left the pending placeholder code in place (opps):
ScenarioContext.Current.Pending();
will flag the test as not implemented.