fix(playwright): stabilize TagSuggestion select + scope tag-chip assertions#27811
Conversation
…rtions - selectTagInTagSuggestion now resolves the listbox via the combobox's aria-controls attribute instead of grabbing the first [role="listbox"] on the page, which races with stale dropdowns left open by previous combobox interactions and caused click() to hang until test timeout. - Scope post-select assertions to tags-container so they no longer match the still-rendered dropdown option in addition to the chip, which was triggering strict-mode violations. - DataProducts spec now dismisses the domain dropdown before opening the tags dropdown so the two listboxes don't overlap.
|
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
Stabilizes Playwright E2E coverage for the new TagSuggestion Autocomplete by making tag selection target the correct dropdown listbox and by scoping “tag chip” assertions to avoid strict-mode collisions with still-rendered dropdown options.
Changes:
- Update
selectTagInTagSuggestionto resolve the listbox via the combobox’saria-controls(with a tag-option-scoped fallback) and scroll the option into view before clicking. - Scope tag assertions in Domains/Data Products flows to
tags-containerso the assertion only matches the selected chip. - Dismiss the domain dropdown in the Data Products flow to prevent overlapping listboxes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts | Makes TagSuggestion selection robust by targeting the correct listbox via aria-controls and ensuring the option is interactable before click. |
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Domains.spec.ts | Scopes tag visibility assertions to tags-container to prevent strict-mode collisions with dropdown options. |
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataProducts.spec.ts | Closes the domain dropdown after selection and scopes tag assertions to tags-container to avoid listbox overlap/flakes. |
…ption testId
Drop the listbox/aria-controls indirection in favour of the unique
tag-option-${fqn} testId. click()'s actionability check covers what the
explicit visibility/scroll waits were doing, and tag option testIds are
unique across comboboxes so listbox scoping wasn't pulling its weight.
Code Review ✅ ApprovedStabilizes TagSuggestion selection and tightens tag-chip assertions in the Playwright test suite. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
🟡 Playwright Results — all passed (18 flaky)✅ 3964 passed · ❌ 0 failed · 🟡 18 flaky · ⏭️ 86 skipped
🟡 18 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 |



Summary
The two TagSuggestion playwright tests added with the new Autocomplete component were failing in nightly:
Changes
Test plan
Ran locally against `http://localhost:8585\` (1.12.0-SNAPSHOT @ `2c262b9abe`):