Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LivingDoc Shows Test Failure for Pending Scenario #2763

Open
sikerlatte opened this issue Aug 22, 2024 · 0 comments
Open

LivingDoc Shows Test Failure for Pending Scenario #2763

sikerlatte opened this issue Aug 22, 2024 · 0 comments
Labels

Comments

@sikerlatte
Copy link

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 sikerlatte added the Bug label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant