SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.24k stars 754 forks source link

Specflow living doc is not generating when pipeline fails #2665

Open thisisnewbi opened 1 year ago

thisisnewbi commented 1 year ago

SpecFlow Version

3.9.74

Which test runner are you using?

NUnit

Test Runner Version Number

3.13.3

.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

Command line – PLEASE SPECIFY THE FULL COMMAND LINE

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

No response

Issue Description

I have below yml configured as a job in gitlab and we have to generate and send this living doc report as a mail.When all test are passing the report gets generated and mail gets sent but when any test fail report is not getting generated

- dotnet tool install --global SpecFlow.Plus.LivingDoc.CLI
    - echo change directory to integration test directory
    - cd $INT_TEST_DIR_SMOKE
    - dotnet restore --source $NUGET_RESTORE_SOURCE
    - dotnet test --configuration $BUILD_CONFIGURATION $INTEGRATION_TEST_PROJ_SMOKE
    - cd bin/Smoketest_automation/Smoketest_automation.csproj/net6.0
    - ls -a
    - livingdoc test-assembly Smoketest_automation.dll -t TestExecution.json

Steps to Reproduce

Use the above yml or refer to mimic the same yml which mainly triggers a unit test project which has specflow feature files. The report is generated when test are passing but not when test are failing ,also the cli package installed version is higher than 3.6 image

Link to Repro Project

No response

DrSheaus commented 1 year ago

I had this exact same issue and found that if I append ' || true' to my 'dotnet test' line, then it generates properly with failed test results in the LivingDoc

thisisnewbi commented 1 year ago

I had this exact same issue and found that if I append ' || true' to my 'dotnet test' line, then it generates properly with failed test results in the LivingDoc

@DrSheaus can you please provide me exact dotnet test command that you used

DrSheaus commented 1 year ago

hope this helps!