Result: built test is not shown in the Test
In my case the reason why tests weren't discovered were because I was using Resharper build.
As soon as I went to: Resharper -> Options -> Tools -> Build -> General: "Use ReSharper Build"(untick), then all tests were suddenly discovered.
in order to configure it to generate MSTest tests you need to add this to your app.config:
<specFlow>
<unitTestProvider name="MSTest"></unitTestProvider>
</specFlow>
I experience this same problem, but the solution was different.
Following the advice on a SpecFlow Github issue, the following worked for me:
I'm running SpecFlow tests with SpecRunner and had this same problem, a couple of times as a matter of fact. Having tried all of the above suggestions, I found that the only solution to the problem was to uninstall and reinstall the SpecRun NuGet package. Next build, tests present in Test Explorer window as expected.
Visual Studio can change the default processor architecture when it loads. While looking endlessly trying to figure out the issue, I finally figured it out, that it wasn't really Specflow causing the issue.
If you have references that require a special architecture, it will prevent the tests from showing up in the test explorer. Change the architecture to x86 or x64 based on your needs.
Another thing you can do to see the build issues is open the Output window and change the dropdown to Tests during build. It will highlight any information of things taking place during your build.
I felt somebody should mention it just in case.
For me, the issue was the TestAssemblyPath in my srprofile file. It didn't match my actual dll name.