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
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.
Until Specflow.Tools.MSBuild.Generation is added, the testsuit wont appear. Once added, only build will reflect the autogenerated class and methods
如果您将此nuget 包Specflow.Tools.MSBuild.Generation
添加到您的项目中, .feature.cs
在您重建时将自动生成.feature.cs
文件。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.