Xunit.Gherkin.Quick icon indicating copy to clipboard operation
Xunit.Gherkin.Quick copied to clipboard

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

Open MPSwift opened this issue 1 year ago • 4 comments
trafficstars

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?

MPSwift avatar May 02 '24 07:05 MPSwift

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.

ttutisani avatar May 02 '24 12:05 ttutisani

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.

MPSwift avatar May 02 '24 13:05 MPSwift

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

ttutisani avatar May 02 '24 14:05 ttutisani