{{ message }}
Repository navigation
Report Playwright steps interrupted by a skip modifier as skipped (fixes #1369) - #1569
Open
dylanpulver wants to merge 1 commit into
Open
dylanpulver wants to merge 1 commit into
dylanpulver wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
getStepStatusDatasees 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