Xunit.Gherkin.Quick
Xunit.Gherkin.Quick copied to clipboard
Test Discovery does not work for Full Framework test projects
If you reference the xunit.gherkin.quick nuget from a full-framework xunit project, the scenarios will never be discovered.
I'm not sure if this is an extra configuration step I'm missing, something that needs fixing in the nuget, or if it is simply not possible. I can throw up a branch with the consumer project converted to demonstrate too.
the same problem
I updated xunit.runner.visualstudio dependency and it solved my problem. (from template I had version 2.3.1 in the project but the last version is 2.4.0 at the moment)
Wow, that's very good to know! Thanks @alborozd
I think this can help others, too.
I have asked a question on stackover flow today and wonder if it is related to this issue?
https://stackoverflow.com/questions/52757138/how-to-get-xunit-to-find-dotnet-core-tests-on-linux-using-xunit-gherkin-quick
I'm pretty new to all of this.. so if it's not related at all.. just a bit desperate to find an answer this. (I have tried xunit.runner.visualstudio and it didn't help.
Did you try the suggestion by @alborozd above?
I updated xunit.runner.visualstudio dependency and it solved my problem. (from template I had version 2.3.1 in the project but the last version is 2.4.0 at the moment)
Thanks for the reply, yeah I have tried doing that and it doesn't seem to make any difference.
Got it. Needs to be investigated. I have not tried it myself yet. I'm using the framework from .NET Core only so far.
The Features text files are very particular about text encoding. I had an issue where a new Feature file and corresponding test class would not be discovered and would not run (locally or on build box). But many existing features existed and run without issue. I created new files with new names and cleaned up the text and simplified the Feature and test to absolute basics. Nothing worked, the test would not be discovered.
So I took a Feature file that I knew worked and copied it as a starting point. Then manually edited it so that it eventually looked like the one the didn't work. But this time the test could be discovered and run, without issue.
Looking at the two files (Working.feature and NotWorking.feature) in Notepadd++ with special chars highlighted or in BeyondCompare revealed nothing useful. However, I don't doubt that there was something abnormal about the encoding.
Summary If you have a Feature file that refuses to be discovered by the test runner, but have other files that are being discovered fine, copy one of the good ones as a starting place and avoid copy-paste from PDFs etc.
@cathalmchale that's a good finding, thanks for posting it here!
Do you mind to open a new issue with that same info in it? That way each issue is for one particular topic and not several - easier for the other readers when they browse through the issue topics.
I just tried and this issue indeed happens. I don't see tests discovered for the normal (full) .net framework. I guess Xunit behaves differently for .net framework as opposed to .net core.
Does anybody have any new findings around this issue?
Following up with Xunit authors about this: https://github.com/xunit/xunit/issues/1993
I am suspecting it has something to do with Xunit, but not sure yet.
I'm struggling as well for my tests to be found in an aspnetboilerplate test project. The only way I can get my methods to be found by the test runner is with the xUnit Fact decorator on each method, but this is actually undesired, because xUnit won't run the methods sequentially.
I'm on the latest xunit.runner.visualstudio (2.4.3)
Not sure what else is needed, I inherit from the Feature class, use the FeatureFile, Given, When, and Then` decorators...
still facing the same until now. So, in short, this library doesn't support .NET Framework. That's it