ttutisani/Xunit.Gherkin.Quick

Tests aren't visible in test explorer in visual studio code

Opened this issue · 3 comments

Hi,
I'm using Visual Studio Code, .NET v8 and the latest version of this framework (v.4.5) but I can't make it to show the tests in the test explorer.
I can see all the other xUnit test cases (see below structur "MyOtherUnitTestCases") but not the cucumber tests ("MyApiTestCases").

I write the cs file with the step definition where given, when, then contains simply a log "not yet implemented" and I have the feature file.
My expectation is to see the tests in the test explorere and if I run them to get the log prints "not yet implemented".

The structur is like:
MyProject
--MyApiTestCases
----MyTest.feature
----MySteps.cs
--MyOtherUnitTestCases
----MyUnitTestA
----MyUnitTestB

What am I missing? Should feature file and cs file have the same name?

Yes, the feature file and cs file are linked using the [FeatureFile] attribute.

If this does not resolve the issue, since there are multiple steps to properly configuring the tests, I suggest that you follow the Getting Started tutorial (on the home page). Once that works, modify to tailor to your needs.

Hm, the [FeatureFile] attribute exist and I followed the getting started but the tests are still not visible in the test explorer in VS Code.
I tried with coping the Calculator.cs, the AddTwoNumbers.cs and AddTwoNumbers.feature but they are also not visible in the test explorer.

So the ProjectConsumer tests are not showing out of the box? Okay, that must be something else, then.