Built tests are not added to the Visual Studio Test Explorer window

前端 未结 10 2277
忘了有多久
忘了有多久 2020-12-14 08:13
  1. I set up the SpecFlow plug-in for the Visual Studio 2013.
  2. I created new Feature Item and build it.

Result: built test is not shown in the Test

10条回答
  •  萌比男神i
    2020-12-14 08:36

    For me, I changed from using direct DLL references to using the NuGet references of version 3.1.7.4 of SpecFlow and this solved the problem.

    I needed to reference "SpecFlow", "SpecFlow.NUnit" and "SpecFlow.Tools.MsBuild.Generation". and then clicked the "Show All Files" button in Visual Studio to see the code behind file at a sibling level to it associated Feature file (this used to be an associated child file of the feature file in older versions).

    I also need to use the "Include In Project" context menu item on the code behind file, for tests to show up in Visual Studios "Test Explorer".

    NOTE: I did try to unzip the Specflow required files from the NuGet package and reference them directly in my project to be consistent with other direct references in my project (non-NuGet references) but this doesn't seem to work and you have to use the NuGet reference. I found an open issue in github, which states that we have to use the Nuget reference to get the tests to work in Test Explorer: https://github.com/techtalk/SpecFlow/issues/1617

提交回复
热议问题