Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specflow is not executing tests in Visual Studio 2019

I have a very weird behavior with Specflow that only applies to one team member. Everyone else have no issue what so ever.

The VS2019 testrunner is correctly displaying all specflow tests, but when "Running all tests" none of the tests gets executed but have the information "no source available". Specflow is generating all cs files correctly.

I tried to create a completly new solution with one unit test project in it, added specflow to it, created a feature, generated the steps and run all tests. Everything worked as expected, the test was executed and was successful. Then I added this new csproj to the other solution where the tests are not exectued. Strangly the "new test" didn't work in the old solution either.

When someone else of the project team is cloning our repository, installing specflow everything works fine for them. It is only this one machine in this one solution. I already tried to reinstall VS2019. We checked that every project in the solution has the same target platform, we tried to delete some %TEMP% files but nothing worked so far.

NuGet packages:

  • SpecFlow v3.0.225
  • SpecFlow.MsTest v3.0.225
  • SpecFlow.Tools.MsBuild.Generation v3.0.225
like image 496
Sir Kato Avatar asked Nov 21 '19 13:11

Sir Kato


1 Answers

I had the same issue as you with:

  • VS 2019 v16.6.2
  • SpecFlow v3.30.2
  • SpecFlow.Tools.MsBuild.Generation v3.3.30
  • SpecRun.Runner v3.3.14
  • SpecRun.Specflow.3-3-0 v3.3.14
  • MSTest.TestAdapter v2.1.2
  • MSTest.TestFramework v2.1.2

I tried many tricks from this forum and Github SpecFlow support and none worked. When I looked at the log file, on the TestResults folder, I saw something interesting:

enter image description here

I basically logged on that link (with the same account that is logged in VS) and the tests start to run.

Hope that solves your business mate. I know these things drives anyone mad.

like image 112
Fábio Avatar answered Oct 01 '22 03:10

Fábio