Search code examples
bddspecflownunit-3.0

How do I show the Steps in a SpecFlow report using nunt 3?


The SpecFlow sample documentation has a show link next to the scenario which I assume shows the steps. enter image description here When I generate my report I don't have this link. enter image description here

I runt the tests and generate the report as follows using Visual Studio 2017 and .NET Framework 4.6.2

%solution_root%packages\NUnit.ConsoleRunner.3.6.1\tools\nunit3-console.exe --labels=All --out=output.txt "--result=output.xml;format=nunit2" SystemIntegration.Test.dll

%solution_root%packages\SpecFlow.2.1.0\tools\specflow.exe nunitexecutionreport %project_file% /xmlTestResult:output.xml /testOutput:output.txt /out:report.html


Solution

  • So, apparently the output.txtneeds to be in the nunit2 format as well but format=nunit2 does not work on that arg. To update the .txt file I added a powershell command to replace => with ***** in the output text file before running the execution report.

    powershell -command "(get-content 'output.txt') | ForEach-Object { $_ -replace '=>', '*****' } | Set-Content 'output.txt'"

    Note: this is fixed in SpecFlow code but not yet released. Will update this answer when fix is available.