Report Playwright steps interrupted by a skip modifier as skipped (fixes #1369) by dylanpulver · Pull Request #1569 · allure-framework/allure-js · GitHub
Skip to content

Report Playwright steps interrupted by a skip modifier as skipped (fixes #1369) - #1569

Open
dylanpulver wants to merge 1 commit into
allure-framework:mainfrom
dylanpulver:fix/step-skip-before-error
Open

dylanpulver wants to merge 1 commit into
allure-framework:mainfrom
dylanpulver:fix/step-skip-before-error

Conversation

@dylanpulver

Copy link
Copy Markdown
Contributor

Context

Fixes #1369.

Playwright gives the reporter no structured signal for this. The modifiers are implemented by throwing, and when one runs in a hook or inside a step the error is attached to the surrounding step, so getStepStatusData sees something indistinguishable from a failure. The skip annotation the reporter reads today only covers the step API (test.step.skip(), stepInfo.skip()), where Playwright swallows the error, which is why those steps never reached that branch. Matching the message is the only handle the reporter has.

The alternative was to move the annotation branch ahead of the error branch. I left the order alone, because a step can carry a skip annotation and an inherited soft assertion error at once, and the error should win in that case.

Residual risk: the match is anchored to the start of the message and to the exact Test is skipped: wording, so it depends on a Playwright internal string and needs a follow up if that wording changes. An error of your own that opens with the same text would be read as a skip.

Four cases in packages/allure-playwright/test/spec/skip.test.ts. Reverting the source change turns three of them red. The fourth covers a real throw in a step and a real throw in a hook and stays green either way, since its job is to catch a match that got too loose.

Checklist

@CLAassistant

CLAassistant commented Aug 21, 2026 •

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[allure playwright] Steps of skipped tests shouldn't be marked as failed

2 participants