Skip to content

Fixes #31636: wait for popover name to resolve in avatar navigation test - #31637

Merged
harsh-vador merged 2 commits into
mainfrom
fix/flaky-user-profile-avatar-navigation-test
Aug 18, 2026
Merged

Fixes #31636: wait for popover name to resolve in avatar navigation test#31637
harsh-vador merged 2 commits into
mainfrom
fix/flaky-user-profile-avatar-navigation-test

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #31636

Users.spec.tsUser Profile Feed InteractionsShould navigate to user profile from feed card avatar click fails intermittently on the merge queue with:

Error: expect(locator).toHaveText(expected) failed
Locator:  locator('[data-testid="user-display-name"]')
Expected: ""
Received: "<user display name>"

Root cause. PopoverTitle (src/components/common/PopOverCard/PopoverTitle.component.tsx) resolves the popover user via useEntityPopoverData. Until that request resolves, userData is undefined, so displayName is '' and [data-testid="user-name"] renders empty. The test captured the expected name with textContent() immediately after the popover became visible — and the popover becomes visible before its user request resolves. On a slow run it captured '' and then asserted the profile-page title equals '', while the page correctly showed the real display name.

Fix. Wait for the popover name to resolve before capturing it, so the assertion compares two real display names:

const userNameElement = popover.getByTestId('user-name');

await expect(userNameElement).not.toBeEmpty();

const expectedUserName = await userNameElement.textContent();

Test-only change; no product code touched.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Hovering a feed card avatar and clicking the user name in the popover navigates to that user's profile page, and the profile title matches the name shown in the popover.

Unit tests

Not applicable — no product logic changed.

Backend integration tests

Not applicable (no backend API changes).

Ingestion integration tests

Not applicable (no ingestion changes).

Playwright (UI) tests

  • Updated: openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Users.spec.ts

Manual testing performed

  1. yarn lint:playwright — 0 errors (only pre-existing no-force-option / no-wait-for-selector warnings on untouched lines).

UI screen recording / screenshots:

Not applicable — no UI changes.

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 UI changes: not applicable, no UI changes.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing (the flaky test itself is the covered scenario).

🤖 Generated with Claude Code

Greptile Summary

The PR stabilizes the user-profile avatar navigation test by waiting for the asynchronously loaded popover name before capturing it.

  • Adds a web-first assertion that waits for the popover username to become non-empty.
  • Retains the existing navigation and profile-name comparison flow.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Users.spec.ts Adds appropriate synchronization before reading the asynchronously resolved popover username; no blocking issue was identified.

Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/flaky-user-..." | Re-trigger Greptile

The popover renders an empty user name until useEntityPopoverData resolves,
so capturing textContent() right after the popover becomes visible could
yield an empty string and make the profile-title assertion compare against
"". Wait for non-empty text before capturing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

@github-actions github-actions Bot added the UI UI specific issues label Aug 17, 2026
@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!

@harsh-vador harsh-vador self-assigned this Aug 17, 2026
@harsh-vador harsh-vador added safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch labels Aug 17, 2026
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit ed2fcaf82a2a14ca11acc94207d82bcbf45379e6 in Playwright run 32056826158, attempt 1.

✅ 75 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 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 50s

⏱️ Max setup 1m 36s · max shard execution 7m 30s · max shard-job elapsed before upload 13m 28s · reporting 2s

🌐 162.21 requests/attempt · 1.71 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 1.71 per UI scenario (137 boots / 80 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 75 0 0 0 0 0

📦 Download artifacts

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

@harsh-vador
harsh-vador added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit 4f7b626 Aug 18, 2026
76 of 79 checks passed
@harsh-vador
harsh-vador deleted the fix/flaky-user-profile-avatar-navigation-test branch August 18, 2026 21:35
@github-actions

Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 2.0 branch.

github-actions Bot pushed a commit that referenced this pull request Aug 18, 2026
#31637)

The popover renders an empty user name until useEntityPopoverData resolves,
so capturing textContent() right after the popover becomes visible could
yield an empty string and make the profile-title assertion compare against
"". Wait for non-empty text before capturing.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 4f7b626)
@gitar-bot

gitar-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates the avatar navigation Playwright test to wait for the popover user display name to resolve before capturing it, fixing flaky test assertions. No issues found.

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

@github-actions

Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 1.13 branch.

github-actions Bot pushed a commit that referenced this pull request Aug 18, 2026
#31637)

The popover renders an empty user name until useEntityPopoverData resolves,
so capturing textContent() right after the popover becomes visible could
yield an empty string and make the profile-title assertion compare against
"". Wait for non-empty text before capturing.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 4f7b626)
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 To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky Playwright test: user profile avatar navigation captures empty expected name

2 participants