I have a problem where my tests are not being shown in the Test Explorer, I have created a feature file and generated step definitions, I have the following packages installed
- SpecFlow-3.1.97
- SpecFlow.Tools.MsBuild.Generation- 3.1.97
- SpecRun.SpecFlow.3-1-0
I have also tried to delete any related to specflow from the %TEMP% folder, It didn't help, also I have different project where I have set up specflow and everything is working fine.
Note: without - SpecRun.SpecFlow.3-1-0 package, The test does get discorvered but i get the following error
OneTimeSetUp: BoDi.ObjectContainerException : Interface cannot be resolved: TechTalk.SpecFlow.UnitTestProvider.IUnitTestRuntimeProvider('nunit')
You get this error, because after you removed the SpecRun.SpecFlow.3-1-0
package, you don't have any package more, that configures the used unit test runner.
One of the following packages has to be added to your specifications project (the one containing your tests) to select your unit test provider:
From https://specflow.org/2019/updating-to-specflow-3/
You get something discovered in Visual Studio because it has its own test discovery. But this has nothing to do when you execute them. We need stuff from the NuGet packages to execute the scenarios.