Step-by-step guide for LivingDoc Generator¶
The LivingDoc Generator enables you to generate living documentation in HTML format with no external dependencies.
Step 1 - Installation¶
> Note: This plugin is only required if you want to generate living documentation with test results, otherwise you can skip this plugin installation and only install the command line tool below. In this example we will be generating LivingDoc with test results.
2- Next, open a command prompt and run the following command to install the CLI tool, this is a mandatory installation:
dotnet tool install --global SpecFlow.Plus.LivingDoc.CLI
Step 2 - Generate LivingDoc¶
1- Navigate to the path where your SpecFlow project is located. In this example, the solution was set up in the
2- Now you can run the LivingDoc CLI by using the below command to generate the report.
livingdoc test-assembly SpecFlowCalculator.Specs.dll -t TestExecution.json
> Note: As mentioned in step 1 the
TestExecution.json file is generated by installing the SpecFlow.Plus.LivingDoc Plugin for your SpecFlow project and holds the tests results. By default,
TestExecution.json will be generated in the test assembly folder of your project e.g.: SpecFlowCalculator.Specs\bin\Debug\netcoreapp3.1\TestExecution.json.
> Note: We are generating LivingDoc with test results here, hence why we are using the test-assembly command. Removing
-t TestExecution.json part of the command will allow you to generate LivingDoc without test results. Check feature-data and feature-folder for alternative commands.
Step 3 - Viewing LivingDoc¶
1- The command-line tool will generate an HTML file titled
LivingDoc.html in the same folder as the output directory of the SpecFlow project. You can manually navigate to this folder and open this file in your favorite browser or use the command-line tool to do it:
> Note: Check here for more info on how to change the output directory of LivingDoc CLI tool.
Here is sample LivingDoc file: