SpecFlow
SpecFlow copied to clipboard
LivinDoc Testfailure-Messages are not line-wrapped correctly
SpecFlow Version
3.9.40 (Specflow), 3.9.57 (LivingDocPlugin)
Which test runner are you using?
NUnit
Test Runner Version Number
Rider Testrunner (2021.3 EAP 10), dotnet test (net6)
.NET Implementation
.NET 5.0
Project Format of the SpecFlow project
Sdk-style project format
.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation NuGet package
Test Execution Method
Command line – PLEASE SPECIFY THE FULL COMMAND LINE
SpecFlow Section in app.config or content of specflow.json
No response
Issue Description
Commandline to execute tests:
dotnet test
Commandline to generate LivingDoc:
livingdoc test-assembly DataGatewayServiceTests.dll -t TestExecution.json
Steps to Reproduce
Create a test which fails with a multiline error-message (e.g. some FluentAssertions-Output on collection-comparison)
This produces output similar to this: ` -> error: Expected property actualTree!.Variables[0].ChildSymbols to be a collection with 2 item(s), but found an empty collection. Expected property actualTree!.Variables[1].ChildSymbols to be a collection with 2 item(s), but found an empty collection.
With configuration:
- Use declared types and members
- Compare enums by value
- Compare tuples by their properties
- Compare anonymous types by their properties
- Compare records by their members
- Include all non-private properties
- Include all non-private fields
- Exclude member TypeName
- Exclude member Attributes
- Match member by name (or throw)
- Be strict about the order of items in byte arrays
- Without automatic conversion. `
In the LivingDoc.html, the message is displayed like this:

It would be nice, if the message respects the line breaks like the output on console.
Link to Repro Project
No response
This could be achieved by adding white-space: pre-wrap CSS property to the error-content class.

Although I think the LivingDoc generator may be closed source? So there might not be an opportunity to implement a fix unless a someone with access can add the property.
Awesome @BL323! I will try to get this small fix into LivingDoc. Warning: It could take a while, next release is planned when we release SpecFlow 3.10.
Sounds good, thanks!