Built tests are not added to the Visual Studio Tes

2019-01-23 06:10发布

  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 Explorer. Why?

I do it according to this video

7条回答
太酷不给撩
2楼-- · 2019-01-23 06:19

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.

查看更多
孤傲高冷的网名
3楼-- · 2019-01-23 06:20

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.

查看更多
可以哭但决不认输i
4楼-- · 2019-01-23 06:29

In my case all the approaches above didn't work. My solution: I don't know why, but - I re-installed "Specflow for Visual Studio 2015" in "Tools => Extensions and Updates", then I've created a new feature file (old still didn't work), and this new feature-file works correctly.

查看更多
欢心
5楼-- · 2019-01-23 06:30

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.

查看更多
地球回转人心会变
6楼-- · 2019-01-23 06:36

if the tests are not showing in the test explorer you need to install NUnit test adapter :

go to Tools->Extensions and updates ->Online->Visual Studio Gallery->Tools->Testing and select NUnit Test Adapter

查看更多
三岁会撩人
7楼-- · 2019-01-23 06:37

I experience this same problem, but the solution was different.

Following the advice on a SpecFlow Github issue, the following worked for me:

  1. Close all Visual Studio instances
  2. Go to %TEMP%\VisualStudioTestExplorerExtensions\
  3. Delete all the folders in here
  4. Try again
查看更多
登录 后发表回答