Skip to content

fix(test): persona spec for AUTs - #30203

Merged
chirag-madlani merged 1 commit into
mainfrom
fix/persona-spec
Jul 18, 2026
Merged

chirag-madlani merged 1 commit into
mainfrom
fix/persona-spec

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Jul 18, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

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.

Summary by Gitar

  • Test improvements:
    • Added retry logic to PersonaDeletionUserProfile.spec.ts to handle eventual consistency when checking for deleted persona visibility.
    • Included a page reload mechanism in the retry loop for PersonaDeletionUserProfile.spec.ts to ensure data synchronization.
    • Added a redirectToHomePage call in PersonaFlow.spec.ts to correctly navigate after default persona verification.

This will update automatically on new commits.

Greptile Summary

This PR adjusts the Playwright persona flows to handle refreshed application state. The main changes are:

  • Retry persona-deletion checks across page reloads.
  • Assert both the removed persona link and the empty persona state.
  • Return the user page home after checking its default persona.

Confidence Score: 5/5

This looks safe to merge after a small test-stability cleanup.

  • The new retry can exhaust its attempts before profile data appears after a reload.
  • The added home redirect does not break later route assumptions.

openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaDeletionUserProfile.spec.ts

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaDeletionUserProfile.spec.ts Adds bounded reload retries for deleted-persona state, but the retry probes can run before profile data has rendered.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaFlow.spec.ts Returns the secondary user page to the home route after verifying the applied default persona.

Reviews (1): Last reviewed commit: "fix(test): persona spec for AUTs" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used (3)

  • Context used - CLAUDE.md (source)
  • Context used - openmetadata-ui-core-components/CLAUDE.md (source)
  • Context used - AGENTS.md (source)

Copilot AI review requested due to automatic review settings July 18, 2026 08:13
@chirag-madlani
chirag-madlani requested a review from a team as a code owner July 18, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

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.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jul 18, 2026
@gitar-bot

gitar-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates persona specification tests by adding retry logic and page reloads to handle eventual consistency, ensuring robust navigation and verification during AUT execution. 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 👍 / 👎 | Gitar

Comment on lines +186 to +188
await page.reload();
await waitForAllLoadersToDisappear(page);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Reload Wait Misses Profile Data

When a reload finishes before the profile request renders its result, waitForAllLoadersToDisappear can return as soon as no loader is present. The loop then uses immediate isVisible() probes and may consume all three attempts before either persona state appears, causing the final empty-state assertion to fail even though deletion completed correctly.

Context Used: CLAUDE.md (source)

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (1 flaky)

✅ 14 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 14 0 1 0
🟡 1 flaky test(s) (passed on retry)
  • Flow/PersonaDeletionUserProfile.spec.ts › User profile loads correctly before and after persona deletion (shard 1, 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

@chirag-madlani
chirag-madlani merged commit be446ea into main Jul 18, 2026
45 of 48 checks passed
@chirag-madlani
chirag-madlani deleted the fix/persona-spec branch July 18, 2026 10:38
harsh-vador added a commit that referenced this pull request Aug 18, 2026
…llback (#31696)

* test(e2e): stop persona specs asserting the system default persona fallback

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) <[email protected]>

* test(e2e): require the persona label to render before asserting on it

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.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

This branch was previously deployed

1 inactive deployment
test — 6c9a9045 Deployed Jul 18, 2026 by chirag-madlani via playwright-ci-postgresql (1, 1) #57132
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