I have bindings in an external assembly (As per the specflow docs here)
We need this, as we are making a generic library of Step Definitions that can be used in any of our test suites.
It works, however some specflow functionality does not appear to work.
Namely:
All steps are highlighted purple (Indicating that it cannot be matched with a binding)
If you select a step and hit F12 or right-click and select "Go To Step Definition", it says it cannot find a matching binding.
However, the code runs OK, and if you debug it, you can step from the feature file into the step definition file, so it appears that the problem is only with the Specflow plugin, not with the nuget package?
Does anyone know how to fix this?
I uploaded the test SLN used in the video here.
The automation that connects the specification to the application interface has to be developed first. The automation that connects the Gherkin specifications to source code is called a binding. The binding classes and methods can be defined in the SpecFlow project or in external binding assemblies.
Cannot find custom tool SpecFlowSingleFileGenerator To enable the extension in Visual Studio, select Tools | Extensions and Updates…, select the “SpecFlow for Visual Studio” extension, then select Enable.
SpecFlow tests are written using Gherkin, which allows you to write test cases using natural languages. SpecFlow uses the official Gherkin parser, which supports over 70 languages.
You need to clear your SpecFlow .cache file in your Temp folder.
In Windows Explorer, go to %TEMP% and then locate and delete your .cache file. It will have a pattern of "specflow-stepmap-[projectname].cache". Restart Visual Studio and the definitions will be recalculated and a new .cache will be created.
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