Repository navigation
test(playwright): reopen dropdowns that close before the option is clicked - #32506
Conversation
…icked Two Data Quality E2E tests opened a dropdown in a single un-retried step and hung to their timeout when it closed underneath them. TestLibrary "external test definitions with read-only fields" — the DQ Dimension select. #32283 hardened the two selects in the create step with selectOptionWithMouse, but this one in the edit step was left as-is and is the one failing in CI. Its listbox is a non-modal React Aria popover, so useCloseOnScroll dismisses it on any scroll of a container holding the trigger, including the scroll Playwright emits to bring the field into view, delivered a frame after the popup opened. expect(option).toBeVisible() still passes during the close animation and the click that follows then waits on a detached node with nothing to reopen the list. Measured on a local stack: a 1px scroll of the drawer's form column closes the listbox, the same nudge on a sibling pane does not. DataQuality "Pagination functionality in test cases list" — NextPrevious wraps the page-size button in an Ant Dropdown, which opens on hover, so a list re-render that shifts the footer out from under the pointer leaves the menu closed for good. Failed 3/3 attempts on two separate runs. Applies the hover-then-click retry already used for this control in utils/common.ts, and moves the menu off Ant Design class selectors onto role-based locators. Verified against a local stack: the DQ Dimension step failed 2/10 on the original with the CI signature and passes 6/6 after. The page-size open was verified by neutralising the hover so only the click fallback could open the menu. Co-Authored-By: Claude Opus 5 <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedFixes two Data Quality E2E test failures caused by dropdowns closing before options could be clicked. The first hardens the DQ Dimension select in the edit step with mouse-based selection to handle non-modal popover scroll-triggered closures; the second applies hover-then-click retry logic to the pagination page-size control and switches to role-based locators. Both fixes are test-only with no product code changes. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are test-only, align with existing retry patterns used elsewhere in the Playwright suite, and address the described flake modes without introducing risky behavior.
Pull request overview
This PR hardens two Playwright Data Quality E2E flows against UI interactions that can “self-cancel” (popover closes on scroll; Ant dropdown hover menu closes when the footer shifts), preventing tests from hanging until timeout.
Changes:
- Reworks DQ Dimension selection in the Test Library edit flow to reopen/re-resolve the listbox on each retry attempt.
- Makes the DataQuality page-size dropdown opening resilient by retrying hover with a click fallback and switching to role-based locators for the open menu.
File summaries
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/TestLibrary.spec.ts | Wraps “Accuracy” option selection in a retryable toPass block that reopens the React Aria listbox when it closes due to scroll. |
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/DataQuality.spec.ts | Retries hover-to-open for the page-size dropdown with a click fallback and replaces antd class-based menu selection with role-based locators. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
✅ Playwright Results — workflow succeededValidated commit ✅ 70 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 46m 46s ⏱️ Max setup 5m 22s · max shard execution 6m 25s · max shard-job elapsed before upload 10m 37s · reporting 3s 🌐 155.53 requests/attempt · 1.60 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
🚦 Removed from the merge queue —
|
…se (#32576) * fix(playwright): stabilise the top-5 merge-group flakes at their cause Across the last 20 merge-queue Playwright runs the same five specs accounted for every hard failure. Each fix removes the specific race — no test.slow, no waitForTimeout — so the offending signature does not reappear on subsequent shard re-orderings. - Features/Table.spec.ts:252 "should persist page size" — NextPrevious wraps the button in an Ant Dropdown with the default hover trigger, so a bare `.click()` only fires preventDefault. Hover-first with a click fallback, wrapped in `toPass`, and locate the menu by role instead of the `.ant-dropdown` class chain that PR #32506 already moved off of for the DataQuality pagination. - Pages/UserDetails.spec.ts:126 "inherited domain after team removal" — the team title existed twice on the page (chip + tree option) and `.locator('[title=…]').nth(1)` raced with the tree-select rebuilding after the hierarchy fetch. Scope the lookup to `.ant-tree-select-dropdown` so the option is unambiguous and Playwright's auto-retry takes over. Also prunes one now-stale `om-playwright/no-positional-locator` suppression (UserDetails: 6 → 5). - Features/AdvancedSearchSuggestions.spec.ts:51 "Verify suggestions for Database field" — the ComboBox popover re-mounts under load and the isMounting gate can drop the aggregate request, so the listbox opens empty. Switch to `waitForAggregation({ field, value })` (matches the typed-value request specifically — an endpoint-only wait resolves early on the dropdown-open request) and wrap the fill + assertion in `toPass` so a dropped request is retried instead of burning 15 s on an empty listbox. - Features/MetricBulkImportExportEdit.spec.ts:1285 "Admin bulk edit renders complex fields from listing hydration" — React Data Grid virtualises columns, and the hard-coded scroll positions `[0, 400, 800, …, 2400]` could skip past the nested-glossary column between samples so it was never in the DOM at any checkpoint. Compute `scrollWidth - clientWidth` and step across in 250 px increments so no column can be missed. - Pages/DataContractInheritance.spec.ts "Remove Asset — Inherited contract no longer shown when asset is removed from Data Product" — contract inheritance propagates asynchronously after /assets/add returns (search index + entity dataProducts update on separate consumers), and the first paint of the asset's Contract tab could land before propagation. That first assertion was timing out at 300 s, exhausting the shard budget and cascading the other seven tests in the same file with "Target page/context/browser has been closed". Wrap the assertion in `toPass` with a full revisit + reopen — fixing the first failure drains the whole cascade. Verification: yarn lint:playwright and yarn tsc:playwright report zero new errors on the touched files. `select_playwright_tests.py --event-name pull_request` picks up all five specs as directChangedSpecs so PR CI runs them under targeted mode; merge_group runs them again in the full plan. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(playwright): match pruned suppression count in the corpus baseline `yarn lint:playwright:suppressions` dropped one entry from UserDetails.spec.ts in the previous commit (positional-locator: 6 → 5) but the hard-coded expected count in the corpus test was not lowered along with it. CI's `corpus.test.mjs` does exact equality, not a ceiling, so the change tripped: om-playwright/no-positional-locator: 1324 → 1323 Lower it. This is the mechanical follow-up the rule's own message asks for ("If you fixed violations, run yarn lint:playwright:suppressions and lower the matching numbers here"). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(playwright): swallow orphaned waitForAggregation rejection Review catch on the Advanced Search fix: `waitForAggregation` returns a `page.waitForResponse` promise armed inside `toPass`. When the 5 s fallback timer wins the race — exactly the dropped-aggregate case this fix targets — the underlying wait keeps running and rejects with a Playwright timeout ~30 s later. Every `toPass` iteration would orphan a fresh promise; Playwright surfaces those as unhandled rejections and can fail the very test the retry loop is meant to stabilise. Attach a no-op `.catch(() => undefined)` at construction so the fallback branch cannot leave a dangling rejection on the microtask queue. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Auto-revert Test <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* test(playwright): reopen dropdowns that close before the option is clicked (#32506) Two Data Quality E2E tests opened a dropdown in a single un-retried step and hung to their timeout when it closed underneath them. TestLibrary "external test definitions with read-only fields" — the DQ Dimension select. #32283 hardened the two selects in the create step with selectOptionWithMouse, but this one in the edit step was left as-is and is the one failing in CI. Its listbox is a non-modal React Aria popover, so useCloseOnScroll dismisses it on any scroll of a container holding the trigger, including the scroll Playwright emits to bring the field into view, delivered a frame after the popup opened. expect(option).toBeVisible() still passes during the close animation and the click that follows then waits on a detached node with nothing to reopen the list. Measured on a local stack: a 1px scroll of the drawer's form column closes the listbox, the same nudge on a sibling pane does not. DataQuality "Pagination functionality in test cases list" — NextPrevious wraps the page-size button in an Ant Dropdown, which opens on hover, so a list re-render that shifts the footer out from under the pointer leaves the menu closed for good. Failed 3/3 attempts on two separate runs. Applies the hover-then-click retry already used for this control in utils/common.ts, and moves the menu off Ant Design class selectors onto role-based locators. Verified against a local stack: the DQ Dimension step failed 2/10 on the original with the CI signature and passes 6/6 after. The page-size open was verified by neutralising the hover so only the click fallback could open the menu. Co-authored-by: Claude Opus 5 <[email protected]> (cherry picked from commit a9b9b93) * Fixes #32968: focus the entity-type trigger before opening its listbox (#32969) React Aria's listbox is a non-modal popover, and a press on a trigger that does not already hold focus both opens it and dismisses it a frame later via the focus transition that same press produces. That left the four cold-click call sites roughly 160ms to pick an option, with nothing to reopen the listbox afterwards, so a loaded runner that missed the window retried the option click until the test timed out and ejected the PR from the merge queue. Collapse all five entity-type selections into one selectEntityType helper built on the focus-first sequence the site at :635 already used and which passed in the same CI run that failed the other two. Co-authored-by: Claude Opus 5 <[email protected]> (cherry picked from commit db52a04) --------- Co-authored-by: Claude Opus 5 <[email protected]>
Describe your changes
Fixes two Data Quality E2E failures where a dropdown was opened in a single un-retried step and the test then hung to its timeout when the dropdown closed underneath it.
1.
TestLibrary.spec.ts— "external test definitions with read-only fields"Failing on the
Accuracyoption of the DQ Dimension select:#32283 hardened the two selects in the create step with
selectOptionWithMouse, but this one in the edit step was left as-is — and it is the one failing in CI.Root cause, reproduced and measured against a local stack: the listbox is a non-modal React Aria popover (
isNonModalon the sharedPopover), and react-aria only armsuseCloseOnScrollfor non-modal popovers. That listener closes the popover on any scroll event whose target contains the trigger — including the scroll Playwright emits to bring a field below the fold into view, which is delivered a frame after the popup opened.Instrumented event log at the moment of failure:
Direct causality test — open the dropdown with all scrolling settled, then nudge one pane by exactly 1 pixel:
.drawer-doc-panel1207 → 1208.drawer-form-content454 → 455expect(option).toBeVisible()still passes during the close animation, and theclick()that follows waits on a node that is already detached — with nothing to reopen the list, so the test burns its whole timeout. The fix reopens and re-resolves on each attempt.2.
DataQuality.spec.ts— "Pagination functionality in test cases list"Failed 3/3 attempts on two separate runs — not flaky.
NextPreviouswraps the page-size button in an AntDropdown, which opens on hover, so the menu is only open while the pointer stays on the button. The failure screenshots show the test-cases list scrolled with the pagination footer off-screen: the hover landed, the rows re-rendered, the footer moved out from under the pointer, and the menu never opened.Applies the hover-then-click retry already used for this same control in
playwright/utils/common.ts, and moves the menu off Ant Design class selectors onto role-based locators (better through the antd → core-components migration).Type of change
Tests
Test-only change; verified against a local stack (no product code touched).
hover()so only the click fallback could open the menu — passes, proving both the fallback and the new role-based locatorThe DataQuality test passes locally either way (the local list does not re-render the way CI's does), so a green run there would prove nothing — hence the forced-fallback verification instead.
Notes for reviewers
There is a product bug behind the first failure that this PR does not fix: any core-components
Selectinside a scrollable pane loses its listbox if that pane scrolls, so a user who scrolls and clicks a dropdown in the same moment sees it flash open and shut.The one-line fix — dropping
isNonModalfromopenmetadata-ui-core-components/.../base/select/popover.tsx— is not safe: the comment there records that modal popovers leavearia-hiddenon the whole app when the popover unmounts abruptly. react-aria exposes no way to keep non-modal and disable close-on-scroll, so this needs an owner decision. Happy to open a separate issue.🤖 Generated with Claude Code