I'm starting with BDD and spec-flow in C# and Visual Studio. I was following a tutorial at https://www.toolsqa.com/specflow/set-up-specflow/ to set up a project but I cannot be shown the tests in visual studio 2017 to run.
The steps I take are the following:
I searched for several tutorials but I can't find what my mistake is or what I'm missing.
Can anyone help me?
Install the "SpecFlow.Tools.MsBuild.Generation" nuget package and rebuild the solution. That should get you going.
We have a "Getting started" guide on the website: https://specflow.org/getting-started/
Also we have some examples here: https://github.com/techtalk/SpecFlow-Examples
You could compare your project with the example if you missed something.
I had the same issue . And when I upgraded my specflow to 3.0.213 , feature.cs and tests were not generated in test explorer. Then I used this MSBUild example with latest specflow to generate feature.cs and tests in test explorer. It uses MSTest as test runner and not Nunit. If test runner doesn't matter to you, use this example. I am running it on visual studio 2019
Had the same issue,
Besides adding the nuget package
SpecFlow.Tools.MsBuild.Generation
as Meza mentioned.
The testes did not appear in the Test Explorer before i added
SpecFlow.NUnit.Runners
besides already having
SpecFlow
SpecFlow.NUnit
NUnit
NUnit3TestAdapter
and the Visual Specflow extension
(VS2019, Specflow 3.1.67)
您最好使用 Visual Studio 2015 来做您想做的事情。
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.