playwright: document overlapping Radix overlay close-animation race - #5
Open
nihal467 wants to merge 1 commit into
Open
playwright: document overlapping Radix overlay close-animation race#5nihal467 wants to merge 1 commit into
nihal467 wants to merge 1 commit into
Conversation
Radix Dialog/Sheet/Popover keep content mounted during their close animation, so opening a second overlay right after closing the first makes a shared locator match both elements (strict-mode 'resolved to 2 elements'). Add a flaky-triage entry (SKILL.md), a Common Pitfall, and a Pattern Gallery snippet showing the toBeHidden() wait and single-dialog getByRole scoping. Learned while fixing the flaky device service history edit test (care_fe QA-214).
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.
What
Documents a Playwright flakiness pattern the skill didn't yet cover: overlapping Radix overlays during close animations.
Radix
Dialog/Sheet/Popoverkeep their content mounted while they animate closed. Opening a second overlay (or clicking a control) immediately after closing the first makes a shared locator resolve to two elements →strict mode violation: resolved to 2 elements.Changes
SKILL.md— new entry in the Flaky triage line.PLAYWRIGHT_GUIDE.md— new Common Pitfall #9 and a Pattern Gallery snippet ("Wait for a Closing Overlay Before Opening the Next") showing thetoBeHidden()wait and the single-dialoggetByRole("dialog")scoping.Guidance added
toBeHidden()before opening/interacting with the next.getByRole("dialog")is a good way to avoid a hard-coded (locale-dependent) dialog title, but it's only unambiguous once exactly one dialog is mounted — so wait for the previous one to unmount first.Context
Learned while fixing the flaky
deviceServiceHistoryedit-flow test incare_fe(ohcnetwork/care_fe#16572, QA-214): the "Add Service Record" sheet lingered during its close animation while the "Edit" sheet opened, so both Service Date pickers matched a single locator.