Skip to content

playwright: document overlapping Radix overlay close-animation race - #5

Open
nihal467 wants to merge 1 commit into
mainfrom
playwright/radix-overlay-close-race
Open

playwright: document overlapping Radix overlay close-animation race#5
nihal467 wants to merge 1 commit into
mainfrom
playwright/radix-overlay-close-race

Conversation

@nihal467

Copy link
Copy Markdown
Member

What

Documents a Playwright flakiness pattern the skill didn't yet cover: overlapping Radix overlays during close animations.

Radix Dialog/Sheet/Popover keep 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 the toBeHidden() wait and the single-dialog getByRole("dialog") scoping.

Guidance added

  • Assert a control unique to the closing overlay is 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 deviceServiceHistory edit-flow test in care_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.

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).
@nihal467
nihal467 requested a review from Jacobjeevan July 16, 2026 06:53
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.

1 participant