-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature file lines always purple when using bindings from external assemblies #179
Comments
Aha! I managed to fix it. In the SLN I posted, I made a new test project and added new files keeping default name, so So if you follow a logical path that you might in a tutorial on using this feature, it does not work until you change the name of the Step Definition file. |
Any progress fixing this? |
@evilC Not unfortunately... |
Is this fixed in the new release? |
@yoyo-array0825 No. If it was, we would have closed this issue. |
Hello, I had this problem yesterday and after trying all the workarounds I finally solved it by uninstalling SpecFlow and installing it again. The underlying problem is described in this post: Helpdesk tactics at it's finest, if something doesn't work, restart, unplug and plug, uninstall then reinstall :) |
Uninstalling and reinstalling Visual Studio 2017's Specflow extension did not seem to fix the issue for me (looked like a simple workaround so was hoping this would work). I ending up having to copy the binding for each sentence individually, and past the binding into the file that already has that binding in it ... then save all files... then I could delete the dummy binding method and then the Specflow feature file would once again have a good link between the Gherkin sentence and the binding code. just another temporary fix and anyone who just has a few lines of Gherkin that got purpled out. |
Deveroom (https://github.com/specsolutions/deveroom-visualstudio) processes the step definitions from the compiled assemblies so it is pretty stable for external assemblies too. |
Hey guys I found a workaround. Go to your Step Definition and in the Binding attribute, add a character to the Gherkin phrase and save file. Return to your .feature file and add that character to the test step. This should reevaluate the step definition file and recognize the binding. Then return to the Step Definition and remove the extra character, save, and do the same in the .feature file. The original Gherkin sentence should have the binding restored. In my case, this resolved ALL of my missing bindings.
|
Steps to resolve
|
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 text was updated successfully, but these errors were encountered: