visual-studiounit-testingvisual-studio-2013specflowtest-explorer

SpecFlow feature not found by Visual Studio Test Explorer


After installing SpecFlow via extensions into VS2013 Ultimate, and added SpecFlow and NUnit to the current Class Library project, creating a feature, and building successfully, the scenarios do not show up in Test Explorer as expected. I've restarted Visual Studio, cleaned and rebuilt, nothing causes the scenarios to show up in Test Explorer.

Any tips?

Feature: SpecFlowFeature1

@mytag
Scenario: Scenario A
    Given X
    When Y
    Then Z

Scenario: Scenario B
    Given X
    When Y
    Then Z

Scenario: Scenario C
    Given X
    When Y
    Then Z

Test Explorer


Solution

  • As well as writing the features, you need to actually generate the code before they will show up in Test Explorer.

    Go to your feature file, and right-click on the page, then select the 'Generate Step Definitions' option. This will then create the actual test code. Then when you compile, the tests will show up in Test Explorer.

    enter image description here