Version number: NUnit 3.12.0
packages.config<PackageReference> tagsSpecFlow.Tools.MsBuild.Generation NuGet packageSpecFlowSingleFileGenerator custom toolEnable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings<Major>.<Minor>.<Patch>
When I create the feature file and build the code, feature.cs is created in the same folder but it doesn't get automatically included in the project. Because of this, the tests are not visible in Test Explorer. Every time I have to manually add the feature.cs file to project. After that the tests are visible in Test Explorer.
Attached below the sample project I created
SpecFlowTest.zip
I have the same issue, only with VS2017 and MSTest.
In the old csproj format (the big xml) the feature.cs files aren't displayed in the solution explorer. This is a limitation in the old project system. It works in the new sdk-style format.
But that doesn't matter, because the files are compiled and the classes are in the compiled assembly. This is all done in the SpecFlow.Tools.MSBuild.Generation package.
The reason you don't see the scenarios in the test explorer is, that you didn't have the NUnit3TestAdapter NuGet package in your project.
I removed the feature.cs files and added the NuGet package and the tests were displayed in the Test Explorer.
In the old csproj format (the big xml) the
feature.csfiles aren't displayed in the solution explorer. This is a limitation in the old project system. It works in the new sdk-style format.
But that doesn't matter, because the files are compiled and the classes are in the compiled assembly. This is all done in theSpecFlow.Tools.MSBuild.Generationpackage.The reason you don't see the scenarios in the test explorer is, that you didn't have the
NUnit3TestAdapterNuGet package in your project.
I removed thefeature.csfiles and added the NuGet package and the tests were displayed in the Test Explorer.
That worked like a charm for me! Thank you so much!
(of course, I used MSTest.TestAdapter in stead)
@Lavernessa Thanks for the feedback. Good too know that it works now for you.
@sanalkr Did it also work for you?
@SabotageAndi It worked. Thank you so much.
Including xxx.feature.cs file into the project is the only way to make F12 / "Go To Test" function work. And without this feature it's almost impossible to use.
I've tried all xUnit, NUnit, MSTest - same problem everywhere
Including xxx.feature.cs file into the project is the only way to make F12 / "Go To Test" function work. And without this feature it's almost impossible to use.
I've tried all xUnit, NUnit, MSTest - same problem everywhere
We've got the same problem (in both VS2017 and VS2019). Using the old .csproj-format, and using MSTest.TestAdapter, the tests _do_ appear in the Solution Explorer, but you can not jump to the the Feature-file from there. The bottom pane of Test Explorer shows "Source: no source available".

Should this be posted as a separate issue?