SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

Wrong test run data is passed to the Livingdoc report.

Open smmaya opened this issue 1 year ago • 1 comments

SpecFlow Version

3.9.57

Which test runner are you using?

xUnit

Test Runner Version Number

2.5.8

.NET Implementation

.NET 6.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

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

No response

Issue Description

There seems to be a issue with what is being passed to the html report. Each time I run all tests (or a test, depending on hooks), a new TestExecution.html is created based on the TestExecution.json, nothing new here. BUT, what I see in the actual report is not the last run, but the one before the last one.

I have no idea if this is a date/time issue as the json "GenerationTime": "0001-01-01T00:00:00" has this value??? The time on the report is 2 minutes late as the files were created at 15h14 2024-04-25 15_15_08-net8 0

2024-04-25 15_27_33-TestExecutionReport html and 6 more pages - Work - Microsoft​ Edge

This is what I call it with: 2024-04-25 15_34_52-USC Schedule Integration Staging SpecFlowTest csproj - Microsoft Visual Studio

Any help is much appreciated.

Steps to Reproduce

Say you set the livingdoc hooks to [AfterFeature] to be faster so you don't wait for all tests to run And that we have those two tests:

Test A

  • Step 1
  • Step 2

Test B

  • Step 1
  • Step 2

Run Test A => if this is the first time you run it, no html report created yet, you will get an empty report Run Test B => now in the report you will see the test run results for the Test A 2024-04-25 15_16_32-_C__git_SpiralSuite_ScheduleStaging_Automation_USC Schedule Integration Staging

Link to Repro Project

No response

smmaya avatar Apr 25 '24 13:04 smmaya

OK, 2 weeks passed with no response, but I managed to find the cause for my livingdoc html report being created BEFORE the TestExecution.json being updated. In my LivingDocHooks class, I simply changed from process.WaitForExit(); to process.WaitForExitAsync(); and now I am getting the right data in the report. You can close this bug, thanks.

smmaya avatar May 07 '24 08:05 smmaya