Hello,
I'm busy working my way through a book which presents a bunch of test cases in Gherkin, so I've been using SpecFlow to implement them and then using Visual Studio's test runner to run them. Except VS's test runner still sucks and I wondered if NCrunch supported SpecFlow. Apparently it does, but I can't get it to to work - the only tests that are detected and executed are three "normal" MSTest tests I created.
I noticed that if I opened the Feature files, NCrunch is showing code coverage markers next to all the test steps, although it states that no tests are covered - yet there's currently 101 of them.
The test project is a .NET Core 2.1 project. The classes being tested are in a .NET Standard 2.0 project. NCrunch doesn't appear to be issuing any warnings or have any problems with the project - as I noted, it's quite happy running 3 old school tests in the same solution. Just in case it was getting confused and only processing one set of tests, I tried deleting the standard tests so only the SpecFlow ones remained, to no avail.
Can you offer any suggestions on how I get NCrunch to run the SpecFlow tests?
Regards;
Richard Moss
[I did search the docs, but not hits for "SpecFlow". Searched the forums, plenty of posts from which I gather it's supposed to "just work"]
Hi,
Thanks for posting. With SpecFlow 3 there are some extra nuget packages that are required to run the tests.
https://specflow.org/documentation/NuGet-Packages/
SpecFlow.Tools.MsBuild.Generation <= this is an important one for NCrunch. We need to generate the code during our builds and store them in the workspace.
Would you mind checking if that is installed?
Thanks for posting. With SpecFlow 3 there are some extra nuget packages that are required to run the tests.
https://specflow.org/documentation/NuGet-Packages/
SpecFlow.Tools.MsBuild.Generation <= this is an important one for NCrunch. We need to generate the code during our builds and store them in the workspace.
Would you mind checking if that is installed?
Hello,
Thanks for the response. I did have the correct packages installed based on the specflow docs that I'd followed (first time using this framework, normally a nunit guy!), but on a whim I commented out the specrun.specflow packagereference and replaced it with specflow.mstest instead and immediately NCrunch kicked in and picked up all the tests. And as a bonus, the tests run immediately instead of having a forced 10 second delay the way the specrun package was apparently doing (that sort of behaviour isn't conducive to a nice debugging experience when you have failing tests!).
Thanks again for the pointer, definitely a relief to be get rid of the awful VS runner and be back in business with NCrunch.
Regards;
Richard Moss
Thanks for the response. I did have the correct packages installed based on the specflow docs that I'd followed (first time using this framework, normally a nunit guy!), but on a whim I commented out the specrun.specflow packagereference and replaced it with specflow.mstest instead and immediately NCrunch kicked in and picked up all the tests. And as a bonus, the tests run immediately instead of having a forced 10 second delay the way the specrun package was apparently doing (that sort of behaviour isn't conducive to a nice debugging experience when you have failing tests!).
Thanks again for the pointer, definitely a relief to be get rid of the awful VS runner and be back in business with NCrunch.
Regards;
Richard Moss
Post a reply
Log in to reply.