-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Multiple scenarios per feature file do not show in the VS Code Test Explorer #94
Comments
Can you please provide the feature file content and the feature class code too? That functionality has not changed recently and the documentation is up to date, to the best of my knowledge. |
Pls check https://github.com/deyanp/XunitGherkinTests in VS Code with .Net Core Test Explorer. What I see is: even though I have 2 scenarios in the feature file (I just copied the first scenario and changed its title, the steps are the same): Feature: AddTwoNumbers Scenario: Add two numbers Scenario: Add three numbers |
Just wanted to add that on the cmd line the tests are recognized ...
|
And one more note ;), the .Net Core Test Explorer for VS Code is issuing the following command to find the tests in a project:
|
I see. Maybe that command is the issue. You need to run tests using Is there a way to configure the vs code to issue the correct command? |
I retested with .Net Core Test Explorer in VS Code, and it issues 2 commands, not 1:
It seems that after discovery .Net Core Test Explorer shows "? Scenario" only but after the run it refreshes the view and displays the correct scenario names |
I see. And what about when you run it from the command line? Does it work fine? Maybe the VS code test runner behaves differently and then this issue needs to be about VS code test runner specifically. I haven't looked into that as I use regular visual studio all this time. |
dotnet test works fine, it lists the individual scenarios, and tells you which one of them fails, and which not. Do you know if it is at all possible to use the --filter arg with dotnet test, and run a single scenario (out of a feature) only? |
Yes, it is possible to only execute certain scenarios. You need to use tags for that. Please take a look at this instruction: https://github.com/ttutisani/Xunit.Gherkin.Quick/blob/master/docs/tags.md In general, you can scroll down the main page of this repo and look through "See Also" section, which might give you many tips and tricks about various capabilities of the framework. |
Any questions on this? Otherwise, this ticket can be closed. |
I create a feature file with 2 scenarios, but when I looked at the VS Code/.NET Test Explorer I see only 1 test for the feature, not 1 for each scenario, as stated here:
"If the feature has multiple scenarios, add them to the same feature file. They will show up as additional tests in the test explorer. And they will need additional methods in the same feature class for execution."
Did something change recently, or I have done something wrong?
The text was updated successfully, but these errors were encountered: