SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

LivingDoc Shows Test Failure for Pending Scenario

Open sikerlatte opened this issue 1 year ago • 2 comments

SpecFlow Version

3.9.74

Which test runner are you using?

NUnit

Test Runner Version Number

4.1.0

.NET Implementation

equal or greater .NET Framework 4.6.1

Project Format of the SpecFlow project

Classic project format using <PackageReference> tags

.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

{ "stepAssemblies": [ { "assembly": "Core.TestManagement" } ], "NRetrySettings": { "maxRetries": 1, "applyGlobally": true }, "runtime": { "missingOrPendingStepsOutcome": "Ignore" } }

Issue Description

LivingDoc is reporting pending tests as a failure rather than Ignored, even though we have specified that outcome in specflow.json.

We run our tests via GitHub actions and execute several feature files at once. In this case, we are running five tests: two of them should be pending, and the other three correctly show as passing on the LivingDoc report. But the pending ones show as "fail."

We set tests as pending by adding an @exclude tag above the Scenario block. In a [BeforeScenario] hook, we correctly identify those with @exclude and call scenarioContext.Pending().

This gives us an exception in our GitHub action report, shown below. It occurs right after all the steps get skipped due to previous errors.

TechTalk.SpecFlow.PendingStepException : One or more step definitions are not implemented yet. Stack Trace: at TechTalk.SpecFlow.ScenarioContext.Pending()

So it seems like the PendingStepException is correctly thrown, but LivingDoc is not picking this up.

Steps to Reproduce

  1. Add custom @exclude tag above Scenario.
  2. Run GitHub action pipeline.
  3. Download LivingDoc and examine test results.

Link to Repro Project

No response

sikerlatte avatar Aug 22 '24 22:08 sikerlatte