Reputation: 417
I want a list of scenarios that are present in my specflow automation project. I can use the test execution report. But I do not want to wait for 70 tests to run before I could get the report.
I have used the dry-run
tag with cucumber before. It doesn't run the tests. It scans through the tests and generates a JSON.
Is there something similar for specflow?
Thanks.
Upvotes: 3
Views: 2016
Reputation: 221
SpecFlow does not have a built in way to generate a simple report of the scenario names.
If the built in SpecFlow.exe reports referenced in the other answers do not provide a suitable option, another alternative is to parse the feature files. An open-source library built for parsing SpecFlow feature files is Pickles. Similar to Cucumber's Relish, Pickles can be executed to generate a list of scenarios in a variety of formats including JSON.
Upvotes: 2
Reputation: 18868
I'm not sure if this is what you are looking for, but the packages/SpecFlow-VERSION/tools/specflow.exe
command line utility has an option called stepdefinitionreport
which might get you something similar.
C:\path\to\your\project> packages\SpecFlow\1.9.0\tools\specflow.exe stepdefinitionreport Your.AcceptanceTests.csproj
It should generate a file call StepDefinitionReport.html. It just spits out the step bindings and not a formatted version of your test suite.
The second option is to use the nunitexecutionreport
option, but this requires you to have run the tests at least once (and to be using NUnit instead of MS Test) and will generate an HTML report.
C:\path\to\your\project> packages\SpecFlow\1.9.0\tools\specflow.exe nunitexecutionreport Your.AcceptanceTests.csproj /out:MyResult.html
Upvotes: 0