test: fix IntakeForm 'pick admin user' Steward popper close hanging for 180s#29771
Conversation
…input
The intake-form "pick admin user" test timed out for the full 180s on every
retry. After selecting the admin option, the Steward entity-ref picker collapses
its input into a read-only chip, so `getByRole('combobox'/'textbox', { name:
'Steward' })` no longer resolves. The `stewardInput.press('Escape')` added in
#29513 then blocked on that vanished locator until the test timed out.
Press Escape on the page instead of the detached input to close the Autocomplete
popper before clicking Save.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
There was a problem hiding this comment.
Pull request overview
This PR fixes a Playwright E2E test hang in the IntakeForm flow by changing how the test dismisses the Steward Autocomplete popper after selecting an option, preventing press('Escape') from blocking on a locator that no longer exists once the selection collapses into a chip.
Changes:
- Replace
stewardInput.press('Escape')withpage.keyboard.press('Escape')to avoid waiting on a detached input. - Add an explanatory comment documenting why the input locator disappears post-selection.
- Keep the
await expect(listbox).toBeHidden()synchronization to ensure the popper is dismissed before Save.
Code Review ✅ ApprovedSwitches the Steward popper dismissal from a locator-based keypress to a page-level keyboard event to prevent test timeouts caused by the input element collapsing into a read-only chip. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
🟡 Playwright Results — all passed (22 flaky)✅ 4483 passed · ❌ 0 failed · 🟡 22 flaky · ⏭️ 37 skipped
🟡 22 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
What / Why
The Playwright test
IntakeForm.spec.ts› pick admin user → DP create succeeds with correct extension payload times out for the full 180s on every retry (3× withtest.slow()), making the wholeIntakeFormproject red.Root cause
#29513added these two lines after the admin option is clicked, to dismiss the Steward Autocomplete popper before clicking Save:But once an option is selected, the Steward entity-ref picker collapses its input into a read-only selected-value chip (
A admin ✕), so the locatorno longer resolves.
stewardInput.press('Escape')then blocks on the vanished element until the test timeout.Evidence from the failing run's captured artifacts:
grouprenderingavatar "A" → "admin" → clear button— there is nocombobox/textboxnamed "Steward" left (the other empty pickers — Owners/Experts/Reviewers — still expose theirs).A admin ✕in the required Steward field, ready to Save. The product works; only the test's teardown-of-the-popper step is broken.Press "Escape".Fix
Press Escape on the page (whatever is focused — i.e. the open popper) instead of on the now-detached input. This preserves the intent of #29513 (close the popper before Save) without depending on a locator that stops existing after selection.
pageis already a fixture in the test signature; no new imports. Theawait expect(listbox).toBeHidden()assertion is kept.Testing
Local static verification only (single-line test change; the scenario needs a running server + a seeded intake form). Relying on CI's Playwright suite to exercise the
IntakeFormproject end-to-end.Greptile Summary
This PR fixes a Playwright test that was timing out for 180 s on every retry because it attempted to press
Escapeon a Steward input element that no longer exists after a selection collapses it into a read-only chip.stewardInput.press('Escape')withpage.keyboard.press('Escape')so the Escape keystroke is sent to whatever is currently focused (the open Autocomplete popper) rather than a stale locator.await expect(listbox).toBeHidden()assertion is preserved unchanged, keeping the original intent of test: close Steward Autocomplete popper before clicking Save #29513 to verify the popper is dismissed before clicking Save.Confidence Score: 5/5
Safe to merge — single-line test fix with no production code changes.
The change swaps a locator-based keypress that was targeting a now-detached DOM element for a page-level keypress that is always valid. The fix is minimal, well-commented, and preserves the follow-up assertion that confirms the popper actually closes. No risk to production code paths.
No files require special attention.
Important Files Changed
stewardInput.press('Escape')withpage.keyboard.press('Escape')to avoid blocking on the Steward picker's input element, which is collapsed into a read-only chip after selection and no longer resolves.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Test participant StewardInput as stewardInput (combobox/textbox) participant Listbox as Autocomplete Listbox participant Page as page.keyboard Test->>StewardInput: click() + fill('admin') StewardInput->>Listbox: opens dropdown Test->>Listbox: click adminOption.first() Note over StewardInput: collapses into read-only chip (combobox/textbox no longer resolves) alt Before fix (broken) Test->>StewardInput: press('Escape') — blocks 180s (element gone) else After fix (correct) Test->>Page: press('Escape') — closes popper immediately end Test->>Listbox: expect(listbox).toBeHidden()%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Test participant StewardInput as stewardInput (combobox/textbox) participant Listbox as Autocomplete Listbox participant Page as page.keyboard Test->>StewardInput: click() + fill('admin') StewardInput->>Listbox: opens dropdown Test->>Listbox: click adminOption.first() Note over StewardInput: collapses into read-only chip (combobox/textbox no longer resolves) alt Before fix (broken) Test->>StewardInput: press('Escape') — blocks 180s (element gone) else After fix (correct) Test->>Page: press('Escape') — closes popper immediately end Test->>Listbox: expect(listbox).toBeHidden()Reviews (1): Last reviewed commit: "test: close Steward popper via page.keyb..." | Re-trigger Greptile