playwright(ui): deflake Teams private-team profile test — assert the team chip instead of blind-clicking it - #31594
Conversation
…team chip instead of blind-clicking it
The tail of `Teams Page › Create a new private team and check if its visible
to admin in teams selection dropdown on user profile` ended with a bare
`getByText(displayName).click()` inside `user-profile-teams`: no visibility
assertion before it, no assertion after it, and no wait for the profile to
settle after the teams PATCH. Any transient re-render of the user page
therefore consumed the full 180s test budget and surfaced as
"Target page, context or browser has been closed" instead of the real cause.
Changes:
- Locate the chip by `data-testid="${name}-link"` (rendered by `Chip`)
instead of by visible text, and hold `name` / `displayName` separately
since the chip's testid uses `name` while the label uses `displayName`.
- Wait for loaders to disappear after the PATCH so a stalled profile fails
fast and legibly.
- Expand the `plus-more-count` overflow before asserting — `Chip` only
renders the first `USER_DATA_SIZE` teams, so on a polluted environment the
new team may not be in the DOM at all.
- Make the trailing navigation meaningful: wait for the team GET, assert its
status, and assert `team-heading` contains the team's display name.
Co-Authored-By: Claude Opus 5 (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! |
✅ Playwright Results — workflow succeededValidated commit ✅ 65 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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) 37m 46s ⏱️ Max setup 1m 46s · max shard execution 6m 54s · max shard-job elapsed before upload 10m 33s · reporting 2s 🌐 169.48 requests/attempt · 1.97 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
🚦 Removed from the merge queue —
|
|
Changes have been cherry-picked to the 2.0 branch. |
…team chip instead of blind-clicking it (#31594) The tail of `Teams Page › Create a new private team and check if its visible to admin in teams selection dropdown on user profile` ended with a bare `getByText(displayName).click()` inside `user-profile-teams`: no visibility assertion before it, no assertion after it, and no wait for the profile to settle after the teams PATCH. Any transient re-render of the user page therefore consumed the full 180s test budget and surfaced as "Target page, context or browser has been closed" instead of the real cause. Changes: - Locate the chip by `data-testid="${name}-link"` (rendered by `Chip`) instead of by visible text, and hold `name` / `displayName` separately since the chip's testid uses `name` while the label uses `displayName`. - Wait for loaders to disappear after the PATCH so a stalled profile fails fast and legibly. - Expand the `plus-more-count` overflow before asserting — `Chip` only renders the first `USER_DATA_SIZE` teams, so on a polluted environment the new team may not be in the DOM at all. - Make the trailing navigation meaningful: wait for the team GET, assert its status, and assert `team-heading` contains the team's display name. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit c2938e3)
|
Changes have been cherry-picked to the 1.13 branch. |
…team chip instead of blind-clicking it (#31594) The tail of `Teams Page › Create a new private team and check if its visible to admin in teams selection dropdown on user profile` ended with a bare `getByText(displayName).click()` inside `user-profile-teams`: no visibility assertion before it, no assertion after it, and no wait for the profile to settle after the teams PATCH. Any transient re-render of the user page therefore consumed the full 180s test budget and surfaced as "Target page, context or browser has been closed" instead of the real cause. Changes: - Locate the chip by `data-testid="${name}-link"` (rendered by `Chip`) instead of by visible text, and hold `name` / `displayName` separately since the chip's testid uses `name` while the label uses `displayName`. - Wait for loaders to disappear after the PATCH so a stalled profile fails fast and legibly. - Expand the `plus-more-count` overflow before asserting — `Chip` only renders the first `USER_DATA_SIZE` teams, so on a polluted environment the new team may not be in the DOM at all. - Make the trailing navigation meaningful: wait for the team GET, assert its status, and assert `team-heading` contains the team's display name. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit c2938e3)
Code Review ✅ ApprovedDeflakes the Teams private-team profile Playwright test by replacing blind text clicks with explicit testid chip locators, loader waits, and assertive navigation checks. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Problem
Fails on
2.0, green onmain.Is a cherry-pick missing? No.
git diff origin/main origin/2.0 -- playwright/e2e/Pages/Teams.spec.ts→ empty. The spec is byte-identical on both branches; every prior deflake (playwright(ui): deflake Teams private-team profile test — drop racy user-refetch wait #29085, (playwright): fix flaky online users & Teams spec #28899, fix(playwright): replace flaky toast assertion with search-based deletion verification in teams & teams drag drop spec #27341, fix(playwright): Fix flaky Teams spec #27276) is present on both.PermissionProvider,useApplicationStore,useResolvedAppMode,UserPage.component.tsx,UserProfileTeams.component.tsx,Chip.component.tsxare identical on both heads — only.lesstoken churn differs.Why only
2.0— submodule pin lag, not codeBetween those two pins
AppRouter.tsxandAuthProvider.tsxchanged substantially (#31301, #31316, #31335, #31369, #31103).AppRoutergained anisModeRoutesPendinggate that renders<Loader fullScreen />insideAuthenticatedAppwhile a non-default app mode's plugin routes are still registering. So the2.0AUT ran a shell that can legitimately swap the whole route subtree for a loader; themainAUT snapshot predates it.mainis not immune — it is stale. Once collatemainbumps its OpenMetadata pin past 2026-08-13, expect the same failure there.The trace agrees: the failure screenshots show the profile content replaced by a centered spinner with a different left sidebar (two extra entries, AskCollate active) — i.e. the route tree remounted under a different shell after the teams PATCH, taking
/users/adminwith it. The same shard also flakedClassicAskCollateNavigation.spec.ts("does not redirect /my-data in Classic mode"), which is the same app-mode churn surfacing elsewhere.Ruled out as the mechanism:
redirectToStoredPath()inPermissionProvider.setUrlPathnameExpiryAfterRoute(utils/AuthProvider.util.ts) stamps theREDIRECT_PATHNAMEcookie with a 1-second expiry, so it is long dead by this point in the test.Why the test turns a transient re-render into a 3-minute hang
The tail of the test was:
Fix
nameanddisplayNameseparately; locate the chip bygetByTestId(${teamName}-link).waitForAllLoadersToDisappear(page)after the PATCH, so a stalled profile fails fast and legibly.plus-more-countbefore asserting, so the overflow cutoff can't hide the new team.GET /api/v1/teams/name/, assert status 200, then assertteam-headingcontains the display name.Same wait-then-assert shape already used elsewhere in this file ("Join team should work properly", "Permanently deleting a team…").
Type of change:
High-level design:
N/A — single-file test change.
Tests:
Use cases covered
isJoinable: false) team via API and it is offered in the teams dropdown on their own profile.Unit tests
Not applicable — Playwright-only change, no product code touched.
Backend integration tests
Not applicable — no backend API changes.
Ingestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
Files updated:
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Teams.spec.ts— test at L458.Manual testing performed
Static gates run locally from
openmetadata-ui/src/main/resources/ui:yarn lint:playwright→ 0 errors, 270 warnings.Teams.spec.ts's 4 warnings are pre-existingbrowser.newPage()fixture notes; no new warning introduced.npx prettier --check playwright/e2e/Pages/Teams.spec.ts→ "All matched files use Prettier code style!"npx tsc --noEmit -p playwright/tsconfig.json→ no errors inTeams.spec.ts(the repo has pre-existing errors in other specs).The E2E itself was not run locally — no OpenMetadata server available in this environment. Requesting a CI run to validate. Repro command for a reviewer with a local stack:
UI screen recording / screenshots:
Not applicable — no UI code changed.
Checklist:
Fixes <issue-number>: <short explanation>— N/A, no issue (nightly flake, matching playwright(ui): deflake Teams private-team profile test — drop racy user-refetch wait #29085).Fixes #<issue-number>above — N/A, see above.Follow-ups (not in this PR)
main's OpenMetadata submodule pin past0d64622448and re-run this shard — that either reproduces the failure onmain(confirming pin lag is the sole branch difference) or narrows the cause to something2.0-only in the Collate tree.PermissionProvider.tsxkeys its effect on[currentUser?.teams, currentUser?.roles], comparing array identity, so every user edit re-runs the full permission bootstrap. Worth comparing by id list instead — wider blast radius, own PR.🤖 Generated with Claude Code
Greptile Summary
The PR updates one Playwright scenario to synchronize explicitly with the private-team profile and navigation flow.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into deflake-teams-p..." | Re-trigger Greptile