Skip to content

fix(playwright): retry oneOf dropdown selection when React Aria popover closes on scroll - #32940

Queued
Rohit0301 wants to merge 11 commits into
mainfrom
playwright-dropdown-closes-immediately
Queued

fix(playwright): retry oneOf dropdown selection when React Aria popover closes on scroll#32940
Rohit0301 wants to merge 11 commits into
mainfrom
playwright-dropdown-closes-immediately

Conversation

@Rohit0301

Copy link
Copy Markdown
Contributor

Describe your changes:

The AutoPilot.spec.ts test (and any other test using selectOneOfOption) was timing out at serviceFormUtils.ts:72 because the React Aria non-modal popover was being dismissed by Playwright's automatic scroll-into-view behavior. The sequence:

  1. selectWidget.click() opens the popover
  2. Playwright auto-scrolls to bring the option into view → fires a scroll event
  3. React Aria closes the popover
  4. Neither option locator is visible; falls through to a broken getByLabel(...).getByText(...) fallback that never matched a real element, blocking until the 8-minute timeout

Fix: replace the multi-path fallback with selectOptionWithRetry(trigger, option) — the existing utility in playwright/utils/common.ts that checks aria-expanded, reopens the dropdown if closed, and retries within expect(...).toPass({ timeout: 15000 }). Also removes .first() positional locators that violated the openmetadata-playwright/no-positional-locators lint rule.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • AutoPilot.spec.ts › Create Service and check the AutoPilot status — the dropdown selection in the service creation form now retries correctly when the React Aria popover closes due to scroll

Unit tests

  • Not applicable (Playwright utility function — tested via E2E).

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Fix is in playwright/utils/serviceFormUtils.ts — the utility used by AutoPilot and any service form test that calls selectOneOfOption.

Manual testing performed

  • Identified root cause via error log: waiting for getByLabel('Backend Connection', { exact: true }).getByText('Backend Connection') — confirmed the broken fallback was the blocking point.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

…er closes on scroll

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Rohit0301 Rohit0301 self-assigned this Sep 8, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Sep 8, 2026
Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/serviceFormUtils.ts Outdated
@github-actions github-actions Bot added the UI UI specific issues label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

…strict-mode violations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit d4eeb20f4b1d7f55abd0659d265d22f061cd7ef2 in Playwright run 34261704456, attempt 1.

✅ 4478 passed · ❌ 0 failed · 🟡 6 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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) 48m 24s

⏱️ Max setup 4m 20s · max shard execution 20m 9s · max shard-job elapsed before upload 23m 59s · reporting 19s

🌐 216.94 requests/attempt · 2.31 app boots/UI scenario · 35.24% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 35.24% (convergence target: at most 15%).
  • Browser traffic was 216.94 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.31 per UI scenario (10954 boots / 4749 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
🟡 Shard chromium-01 160 0 1 0 0 0
✅ Shard chromium-02 154 0 0 0 0 0
✅ Shard chromium-03 133 0 0 0 0 0
✅ Shard chromium-04 148 0 0 0 0 0
🟡 Shard chromium-05 145 0 1 0 0 0
✅ Shard chromium-06 128 0 0 0 0 0
✅ Shard chromium-07 200 0 0 0 0 0
✅ Shard chromium-08 165 0 0 0 0 0
🟡 Shard chromium-09 185 0 2 0 0 0
✅ Shard chromium-10 146 0 0 0 0 0
✅ Shard chromium-11 139 0 0 1 0 0
✅ Shard chromium-12 158 0 0 0 0 0
✅ Shard chromium-13 114 0 0 0 0 0
✅ Shard chromium-14 173 0 0 0 0 0
🟡 Shard chromium-15 132 0 1 0 0 0
🟡 Shard chromium-16 158 0 1 0 0 0
✅ Shard chromium-17 164 0 0 0 0 0
✅ Shard chromium-18 202 0 0 0 0 0
✅ Shard chromium-19 160 0 0 0 0 0
✅ Shard chromium-20 157 0 0 0 0 0
✅ Shard chromium-21 162 0 0 0 0 0
✅ Shard chromium-22 164 0 0 0 0 0
✅ Shard chromium-23 187 0 0 0 0 0
✅ Shard chromium-24 155 0 0 0 0 0
✅ Shard chromium-25 139 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 51 0 0 0 0 0
✅ Shard import-export-02 65 0 0 0 0 0
✅ Shard import-export-03 34 0 0 0 0 0
✅ Shard ingestion-01 36 0 0 0 0 0
✅ Shard ingestion-02 50 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 6 flaky test(s) (passed on retry)
  • Features/ContextCenterArticles.spec.tsArticle listing search filters, clears, and shows empty state (shard chromium-01, 1 retry)
  • Pages/EntityDataSteward.spec.tsUser as Owner Add, Update and Remove (shard chromium-05, 1 retry)
  • Features/PersonaAIContext.spec.tsView in Explore link href reflects the selected entity type (shard chromium-09, 1 retry)
  • Pages/ExploreTree.spec.tsCopy field link should have valid URL format for APIEndpoint (shard chromium-09, 1 retry)
  • Pages/Entity.spec.tsTier Add, Update and Remove (shard chromium-15, 1 retry)
  • Features/OntologyStudioIntegration.spec.tsdata mode renders tagged assets from the ontology data response (shard chromium-16, 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

…try to handle React Aria scroll-dismissal

- AirflowIngestionClass: fix option name 'BackendConnection' → 'Backend Connection'
- serviceFormUtils: migrate selectIngestionRunnerFromDropdown to selectOptionWithRetry
- ServiceBaseClass: migrate runner select to selectOptionWithRetry, remove .first() positional locator
- ConnectionConfigLayout: migrate chooseSelectOption to selectOptionWithRetry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rohit0301 and others added 4 commits September 8, 2026 23:27
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t strict-mode violations

- ServiceBaseClass: update displayName to full label 'Collate SaaS Runner' (was substring 'Collate SaaS')
- Both runner option locators now use exact: true, consistent with selectOneOfOption

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Fixes React Aria popover dismissal on scroll during oneOf dropdown selection by replacing the fallback logic with selectOptionWithRetry, which reopens the dropdown if needed and retries within a 15-second timeout. Also removes .first() positional locators and adds exact matching to option locators to resolve strict-mode violations. No issues found.

✅ 2 resolved
Edge Case: Option locator may match multiple options (strict-mode)

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/serviceFormUtils.ts:51-53
getByRole('option', { name: optionName }) uses Playwright's default substring, case-insensitive name matching, so when one option name is a prefix/substring of another (e.g. SupersetConnection vs SupersetApiConnection), the locator resolves to multiple elements and option.click() inside selectOptionWithRetry throws a strict-mode violation on every retry, failing after the 15s timeout. The old code masked this with .first(); since that was removed for the lint rule, add { exact: true } to keep the match unambiguous.

Edge Case: Runner option locator omits exact match (substring)

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/serviceFormUtils.ts:76-80 📄 openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts:137-141
Unlike the oneOf path (which now uses exact: true after the earlier strict-mode fix), the runner-dropdown option locators use getByRole('option', { name: runnerDisplayName }) with substring accessible-name matching. If more than one runner option's label contains runnerDisplayName, option.click() inside selectOptionWithRetry throws a strict-mode violation that repeats until the 15s toPass timeout, failing the test with an opaque error. Substring matching was intentional (per the removed comment, to tolerate a display-name suffix), so keep it only if a suffix match is truly needed; otherwise pass exact: true for consistency and clearer failures.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

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.

2 participants