LivingDoc Plugin Setup

If you want to generate LicingDoc with test results you must install this plugin, otherwise, you may skip this step to generate LivingDoc without test results.

Installation

Add the SpecFlow.Plus.LivingDocPlugin NuGet package to your SpecFlow project.

Configuration

LivingDoc Generator configuration options have a default setting. Simple SpecFlow projects may not require any further configuration.

livingDocGenerator

Use this section to extend your specflow.json with LivingDoc Generator configuration.

Attribute Value Description
enabled true/false Determines whether SpecFlow should generate the json file.
Default: true
filePath absolute /relative path The path of the generated json. Can be an absolute path or a relative path to the TestAssembly.
Default: TestExecution.json (in the same folder as the TestAssembly).

Placeholder support in filePath

The following placeholders are supported inside the filePath:

  • {CurrentDirectory} the current working directory. Note: Add this placeholder if the TestExecution.json file is not generated to the output directory. This is required in case of xUnit targeting full framework.
  • {ProcessId} the Id of the current process
  • {ThreadId} the Id of the current thread

These placeholders can be used to make the generated file name unique when the tests are running in parallel and the test runner supports process level isolation like the SpecFlow+Runner

Examples

simple specflow.json example:

{
  "livingDocGenerator": {
    "enabled": true,
    "filePath": "TestExecution.json"
  }
}

specflow.json example with CurrentDirectory placeholder:

{
  "livingDocGenerator": {
    "enabled": true,
    "filePath": "{CurrentDirectory}\\TestExecution.json"
  }
}

specflow.json example for SpecFlow+Runner using Process isolation:

{
  "livingDocGenerator": {
    "enabled": true,
    "filePath": "TestExecution_{ProcessId}_{ThreadId}.json"
  }
}