Repository navigation
test(e2e): stop persona specs asserting the system default persona fallback - #31696
Conversation
…llback Backports the persona-specific parts of #31063, #30699, #30203 and #30732 to 1.13, where these fixes were never cherry-picked. The user default-persona chip renders user.defaultPersona, and the backend resolves an unset user default to the SYSTEM default persona (UserRepository.getDefaultPersona). Two specs asserted the "no default persona" placeholder, which therefore only appears when nothing else has set a system default — global state neither test owns. - PersonaFlow.spec.ts "Set default persona for team": asserts the team persona is not auto-applied (the actual invariant) instead of the placeholder text, with a visibility check first so the negative assertion cannot pass against a chip that never rendered. - Users.spec.ts persona removal: scopes the default-tag and radio assertions to the user's own personas instead of every persona-label in the dropdown. - PersonaFlow.spec.ts "Default persona setting and removal flow": moves the shared module-level UserClass into the describe, adds an afterAll teardown for the user and both personas, and closes the user browser context in a finally, so this describe no longer leaks a system default persona into sibling specs. - persona.ts: waits for the confirmation modal's "Yes" button (the modal testid is on the 0x0 .ant-modal-root wrapper, so toBeVisible always reports hidden) and scopes the response wait to PATCH /api/v1/personas/{id} so an in-flight GET cannot satisfy it. The server-side persona search step present in main is deliberately not backported: it depends on the /api/v1/personas/search endpoint from #30469, which 1.13 does not have. 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! |
❌ UI Checkstyle Failed❌ Playwright - ESLint + Prettier + Organise ImportsOne or more Playwright test files have linting or formatting issues. Affected files
❌ Core Components - I18n SyncCore-components ❌ Antd + Less Deprecation GuardA new Affected filesat Function._resolveFilename (node:internal/modules/cjs/loader:1401:15) Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
Both negative assertions run against a filtered locator that is allowed to match nothing, so they pass when the fixture persona is absent from the dropdown entirely — the test would go green without ever checking the persona whose default was removed. Assert the label is visible first, matching the guard already used on the default persona chip in PersonaFlow.spec.ts.
|
Good catch — fixed in 8bc6fd3.
Added |
Code Review ✅ ApprovedBackports persona E2E test isolation and helper synchronization fixes to 1.13, ensuring specs do not rely on leaked system default personas. 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 |
What
Backports the persona-specific parts of #31063, #30699, #30203 and #30732 to 1.13, where they were never cherry-picked.
mainand2.0already carry all four, which is why this failure is 1.13-only.RCA
Team persona setting flow > Set default persona for team should work properlyfails at:Not a product bug — the assertion depends on global state the test does not own.
user.defaultPersona(UserProfilePersona.component.tsx).UserRepository.getDefaultPersona)."No default persona"only ever renders when nothing else has a system default set.Default persona setting and removal flow) sets and then clears a system default, and the AUT ships with a pre-seededOnboarding System Default Experiencepersona. The received value in the trace —PW Persona ac9eb…— is that sibling's own fixture, not the team persona.So the assertion was passing on another test's side effect. In 1.13 that leak is worse than upstream: the sibling describe shares a module-level
UserClasswithPersona operationsand has no teardown at all, so its personas and the system default it set survive the run.Two secondary defects in the shared helpers, same class of problem:
persona.tswaited onpage.waitForResponse('/api/v1/personas/*')— an unfiltered matcher that any in-flight GET can satisfy, so the helper could return before the PATCH landed.toBeVisibleondefault-persona-confirmation-modal, a testid that sits on the antd.ant-modal-rootwrapper (0x0) and therefore always reports hidden.Users.spec.tscarried the same system-default-fallback bug in the persona-removal test: it asserted nodefault-persona-tagand zero checked radios across everypersona-labelin the dropdown, which the system default persona trips.#30278(fix(ui): stop showing inherited team persona as user default persona) is already in 1.13 asbba09e4424e—UserProfilePersona.component.tsxis byte-identical tomain. Not the cause here.Changes
PersonaFlow.spec.ts— team persona step now asserts the real invariant (the team's persona is not auto-applied as the user default) instead of the placeholder text, preceded by a visibility check so the negative assertion cannot pass against a chip that never rendered. (test(e2e): fix 12 chronically flaky Playwright tests #31063)PersonaFlow.spec.ts—Default persona setting and removal flowgets a describe-localUserClass, anafterAlldeleting the user and both personas,userContext.close()in afinally, and theredirectToHomePage(userPage)after the first verification step. Stops this describe leaking a system default persona into sibling specs. (fix(test): persona related flaky tests #30180, fix(test): persona spec for AUTs #30203; upstream shipped the teardown inside the refactor(context-center): wrap header components with HeaderShell #29964 HeaderShell refactor, so applied directly rather than cherry-picked)Users.spec.ts— persona-removal assertions scoped to the user's ownpersona1/persona2labels. (fix(test): account for system default persona fallback in Users persona removal e2e #30732)utils/persona.ts—setPersonaAsDefault/removePersonaDefaultwait on the modal's Yes button and scope the response wait toPATCH /api/v1/personas/{id}, registered immediately before the click. (test(playwright): batch seven queued flaky-spec stabilizations into one merge-queue entry #30699)Deliberately not backported
The
default-persona-select-listserver-side search step present inmain— it requires/api/v1/personas/searchfrom #30469, a feature PR absent from 1.13. Porting the test alone would 404.Verification
tsc --noEmit -p playwright/tsconfig.json: error set for these three files unchanged against the pre-change baseline (one pre-existing unusedgetApiContextinUsers.spec.ts)🤖 Generated with Claude Code
Greptile Summary
The PR makes persona E2E coverage independent of the system-default persona fallback and improves test isolation and response synchronization.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "test(e2e): require the persona label to ..." | Re-trigger Greptile