Merging Multiple Test Results

Use case

If you have been running your tests in parallel using SpecFlow+Runner or any other Runner, your test results may end up in multiple JSON files. You may also have different testing stages running in parallel, which would produce multiple JSON files.

You have the option to combine these JSON files that carry your test results data into a single Living Documentation, depending on which SpecFlow LivingDoc tool you are using:

SpecFlow+LivingDoc Generator

To merge multiple JSON files in the command-line tool simply separate them with a space:

C:\work\BookShop\BookShop.AcceptanceTests\bin\Debug\netcoreapp3.1>livingdoc test-assembly BookShop.AcceptanceTests.dll -t TestExecution_1.json TestExecution_2.json

In the above example we are generating LivingDoc from the test assembly which is located in our local C:\work\BookShop\BookShop.AcceptanceTests\bin\Debug\netcoreapp3.1 directory. We also have two JSON files, TestExecution_1 & TestExecution_2, that are generated when we executed our tests in the same folder. As you can see you can include any number of JSON files by separating them with a space.

If you choose to includes all of your JSON files you can use the wild card * to do so:

C:\work\BookShop\BookShop.AcceptanceTests\bin\Debug\netcoreapp3.1>livingdoc test-assembly BookShop.AcceptanceTests.dll -t TestExecution*.json

SpecFlow+LivingDoc for Azure DevOps

To merge multiple JSON files in Azure Devops you have to include them in your build step in separate lines: