Skip to content

fix(playwright): stabilize TagSuggestion select + scope tag-chip assertions#27811

Merged
siddhant1 merged 2 commits intoopen-metadata:mainfrom
siddhant1:fix/tag-suggestion-strict-mode
Apr 29, 2026
Merged

fix(playwright): stabilize TagSuggestion select + scope tag-chip assertions#27811
siddhant1 merged 2 commits intoopen-metadata:mainfrom
siddhant1:fix/tag-suggestion-strict-mode

Conversation

@siddhant1
Copy link
Copy Markdown
Member

Summary

The two TagSuggestion playwright tests added with the new Autocomplete component were failing in nightly:

  • Domains › Create domain with tags using TagSuggestion — strict-mode violation: `getByTestId('add-domain-form').getByText(tag.displayName)` matched both the chip and the still-rendered dropdown option.
  • Data Products › Create data product with tags using TagSuggestion — `tagOption.click()` hung for the full 60 s test timeout. The helper grabbed `page.locator('[role="listbox"]').first()`, which can resolve to the previous (domain) listbox left open from the prior step and never match the tag option's parent.

Changes

  • `playwright/utils/tag.ts` — `selectTagInTagSuggestion` now resolves the listbox via the combobox's `aria-controls` attribute (with a tag-option-scoped fallback) instead of `[role="listbox"].first()`. Adds `scrollIntoViewIfNeeded` before clicking.
  • `playwright/e2e/Pages/Domains.spec.ts` (1170, 1222) — assertion scoped to `tags-container` so it only matches the chip.
  • `playwright/e2e/Pages/DataProducts.spec.ts` (491) — same assertion scoping. Also dismiss the domain dropdown after selecting the domain so the two listboxes don't overlap.

Test plan

Ran locally against `http://localhost:8585\` (1.12.0-SNAPSHOT @ `2c262b9abe`):

  • Single run of both specs — 5 passed (50.3s)
  • `--repeat-each=5` flake check — 13 passed (2.3m), no flakes:
    • Domains › Create domain with tags using TagSuggestion: 5/5 ✓ (avg 6.0s)
    • Data Products › Create data product with tags using TagSuggestion: 5/5 ✓ (avg 8.4s)
  • CI nightly green

…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.
Copilot AI review requested due to automatic review settings April 29, 2026 08:31
@siddhant1 siddhant1 requested a review from a team as a code owner April 29, 2026 08:31
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 selectTagInTagSuggestion to resolve the listbox via the combobox’s aria-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-container so 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.
@siddhant1 siddhant1 added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Apr 29, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 29, 2026

Code Review ✅ Approved

Stabilizes TagSuggestion selection and tightens tag-chip assertions in the Playwright test suite. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 61%
62.06% (62281/100356) 42.24% (33375/79007) 45.29% (9896/21850)

@sonarqubecloud
Copy link
Copy Markdown

@siddhant1 siddhant1 merged commit 2cd827d into open-metadata:main Apr 29, 2026
42 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (18 flaky)

✅ 3964 passed · ❌ 0 failed · 🟡 18 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 298 0 1 4
🟡 Shard 2 743 0 2 8
🟡 Shard 3 753 0 2 7
🟡 Shard 4 755 0 4 18
🟡 Shard 5 685 0 2 41
🟡 Shard 6 730 0 7 8
🟡 18 flaky test(s) (passed on retry)
  • Flow/Tour.spec.ts › Tour should work from URL directly (shard 1, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity event is created when description is updated (shard 2, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity event shows the actor who made the change (shard 2, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show "Active recently" for users active within last hour (shard 3, 1 retry)
  • Flow/IngestionBot.spec.ts › Ingestion bot should be able to access domain specific domain (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Set & Update all CP types on apiCollection (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for MlModel (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for SearchIndex (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Set (shard 4, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tag Add, Update and Remove (shard 5, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Features/AutoPilot.spec.ts › Create Service and check the AutoPilot status (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Add, Update and Verify Data Glossary Term (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for mlModel -> dashboard (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/SubDomainPagination.spec.ts › Verify subdomain count and pagination functionality (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants