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

前端 未结 10 2215
忘了有多久
忘了有多久 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条回答
  • 2020-12-14 08:31

    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

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2020-12-14 08:36

    I tried installing the Nugget package

    SpecFlow.Tools.MsBuild.Generation
    

    with the same version than specflow and now I can see the test in TestExplorer, other ways not works for me.

    I already had installed 1 from

    Nugget Package Specflow
    Specflow.NUnit
    Nunit
    Nunit3TestAdapter
    

    and the extension for Visual Studio for Specflow a NUnitTestAdapter

    0 讨论(0)
  • 2020-12-14 08:41

    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.

    0 讨论(0)
提交回复
热议问题