1
votes

The SpecFlow report generation using nUnit is not working as expected.

The expected report should display the results of the execution as well, whereas the execution result is not displayed at all. Instead, only the tests are listed.

I am using the below format to generate the report.

specflow.exe nunitexecutionreport "C:\Users\Paresh\Documents\Visual Studio 2015\Projects\SpecFlowDemoNUnit\SpecFlowDemoNUnit\SpecFlowDemoNUnit.csproj" /xmlTestResult:"C:\Tests.xml" /out:"C:\Tests.html"

The file Tests.xml is generated after executing the tests using 'nunit3-console.exe'.

The versions used: SpecFlow.2.1.0 NUnit.3.6.0

1
Are you running the tests from the command line in order to automate (like Jenkins builds etc.)? - sashoalm
Yes.. I am running the tests from command line. However, the issue is resolved as I mentioned in the answer. Do you have any idea, on how to generate such SpecFlow reports if the tests are run from Test Explorer window? Again, nUnit 3.6.0 is used for execution. - PareshD

1 Answers

1
votes

I figured out that the SpecFlow report generation with nUnit is probably broken with SpecFlow.2.1.0 and NUnit.3.6.0.

But after using a parameter 'format=nunit2' while executing the tests via nUnit console, the report generation worked. So finally, the commands used will look like these:

nUnit test execution:

nunit3-console.exe --labels=All --out=TestResult.txt "-- result=TestResult.xml;format=nunit2" bin\Debug\SpecFlowDemoNUnit.dll

SpecFlow Report Generation:

specflow.exe nunitexecutionreport SpecFlowDemoNUnit.csproj /out:MyResult.html

Here is the reference link:

https://github.com/techtalk/SpecFlow/wiki/Reporting