2

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

3
  • If I am reading your question correctly, I believe that you should be using a Blank Project not a Class Library Project. If you are creating Library functions, you'll just create those as C# files in the project in a "Lib" (or similar) folder. Commented Mar 1, 2016 at 4:01
  • what test framework is specflow configured to use? Commented Mar 1, 2016 at 10:40
  • Assuming nunit, have you verified that plain nunit tests show up in the explorer? Commented Mar 1, 2016 at 11:30

4 Answers 4

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

NuGET Package

Until Specflow.Tools.MSBuild.Generation is added, the testsuit wont appear. Once added, only build will reflect the autogenerated class and methods

Comments

0

If you add this nuget package Specflow.Tools.MSBuild.Generation into your project, .feature.cs files will be generated automatically when you rebuild.

Comments

0

You might be missing a test adapter.

if you are using Nunit for testing you can add the nugget package NUNIT3TestAdapter, if mstest then mstest.TestAdapter

after adding, build and they should appear in the test explorer

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.