Skip to content

fix(wdio-allure-reporter): properly resolve pending steps and status …#15130

Merged
christian-bromann merged 1 commit intomainfrom
fix-allure-reporter-hooks-unknown-status
Mar 5, 2026
Merged

fix(wdio-allure-reporter): properly resolve pending steps and status …#15130
christian-bromann merged 1 commit intomainfrom
fix-allure-reporter-hooks-unknown-status

Conversation

@mccmrunal
Copy link
Copy Markdown
Contributor

…when hooks fail

Proposed changes

This PR fixes an issue where failing before() hooks in Mocha generate an Unknown status string instead of "broken", and skip attaching their internal test steps in the Allure reports.

The "Unknown" status and missing steps in Allure reports were caused by a race-like instability in state management during the hook lifecycle. Specifically, the onHookEnd method was mutating the _hasPendingTest flag in the middle of its execution, which caused subsequent conditional checks to fail and skip critical test-ending logic. Simultaneously, when a failing hook forced a test to start and stop dynamically, the state manager was unable to locate a valid endIdx for the execution steps, resulting in orphan steps that never made it into the final report.

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Backport Request

//: # (The current main branch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against the v8 branch.)

  • This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

Further comments

Reviewers: @webdriverio/project-committers

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 5, 2026

Open in StackBlitz

create-wdio

npm i https://pkg.pr.new/webdriverio/webdriverio/create-wdio@15130

eslint-plugin-wdio

npm i https://pkg.pr.new/webdriverio/webdriverio/eslint-plugin-wdio@15130

@wdio/allure-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/allure-reporter@15130

@wdio/appium-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/appium-service@15130

@wdio/browser-runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/browser-runner@15130

@wdio/browserstack-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/browserstack-service@15130

@wdio/cli

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/cli@15130

@wdio/concise-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/concise-reporter@15130

@wdio/config

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/config@15130

@wdio/cucumber-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/cucumber-framework@15130

@wdio/dot-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/dot-reporter@15130

@wdio/firefox-profile-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/firefox-profile-service@15130

@wdio/globals

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/globals@15130

@wdio/jasmine-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/jasmine-framework@15130

@wdio/json-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/json-reporter@15130

@wdio/junit-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/junit-reporter@15130

@wdio/lighthouse-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/lighthouse-service@15130

@wdio/local-runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/local-runner@15130

@wdio/logger

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/logger@15130

@wdio/mocha-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/mocha-framework@15130

@wdio/protocols

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/protocols@15130

@wdio/repl

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/repl@15130

@wdio/reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/reporter@15130

@wdio/runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/runner@15130

@wdio/sauce-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/sauce-service@15130

@wdio/shared-store-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/shared-store-service@15130

@wdio/smoke-test-cjs-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-cjs-service@15130

@wdio/smoke-test-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-reporter@15130

@wdio/smoke-test-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-service@15130

@wdio/spec-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/spec-reporter@15130

@wdio/static-server-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/static-server-service@15130

@wdio/sumologic-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/sumologic-reporter@15130

@wdio/testingbot-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/testingbot-service@15130

@wdio/types

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/types@15130

@wdio/utils

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/utils@15130

@wdio/webdriver-mock-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/webdriver-mock-service@15130

@wdio/xvfb

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/xvfb@15130

webdriver

npm i https://pkg.pr.new/webdriverio/webdriverio/webdriver@15130

webdriverio

npm i https://pkg.pr.new/webdriverio/webdriverio@15130

commit: 5894e6f

Copy link
Copy Markdown
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Mar 5, 2026
@christian-bromann christian-bromann merged commit 10c7a31 into main Mar 5, 2026
61 checks passed
@christian-bromann christian-bromann deleted the fix-allure-reporter-hooks-unknown-status branch March 5, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants