Skip to content

cherry-pick(2.0): Fix the CustomizeWidget CustomizeLandingPage tests (#31551) - #31579

Closed
aniketkatkar97 wants to merge 1 commit into
2.0from
cherry-pick/2.0-customize-widget-fixes
Closed

cherry-pick(2.0): Fix the CustomizeWidget CustomizeLandingPage tests (#31551)#31579
aniketkatkar97 wants to merge 1 commit into
2.0from
cherry-pick/2.0-customize-widget-fixes

Conversation

@aniketkatkar97

Copy link
Copy Markdown
Member

Clean cherry-pick of 2b11ddab (#31551) from main onto 2.0, as planned after the main merge.

Carries:

🤖 Generated with Claude Code

* Fix the CustomizeWidget CustomizeLandingPage tests

* Worked on comment

* fix(e2e): make widget skeleton waits target the real data-testid

widget.locator('entity-list-skeleton') is a tag-name selector that never
matches anything - the skeleton renders data-testid="entity-list-skeleton" -
so every 'wait for widget data to settle' in widgetFilters.ts resolved
instantly. The sort/filter flows then clicked dropdown -> item -> dropdown ->
item with zero settle time between refetches, which is the race window behind
the CustomizeWidgets widget-filter hangs in nightly AUT runs.

Use getByTestId like the three already-correct call sites in the same file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(playwright): map landing-page/customization helper modules to their specs

customizeLandingPage.ts and widgetFilters.ts are shared by every
landing-page/customization spec, but changes to them were unmapped in the
impact map - a helper-only PR ran smoke + canary while CustomizeWidgets,
CustomizeLandingPage and the other importers of the changed code never ran.

Map both helpers to their exact importer specs (LandingPageWidgets as a
directory glob). DataInsight.spec.ts is @data-insight-tagged, hence the
Data Insight project alongside chromium.

Verified with select_playwright_tests.py: the changed files of this PR now
select all 12 specs with zero unmapped files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(e2e): isolate persona and user per test in CustomizeLandingPage spec

Same class of bug as #31407/#31408, seen in AUT run 31867679974. The file
shared one persona and one user across tests, and only 'Add, Remove and
Reset' set the user's default persona (via the profile UI, mid-test). Under
fullyParallel the file's tests run in different workers - each worker's
beforeAll created its own user that never got a default persona, so
'Widget drag and drop reordering' saved the persona layout correctly but
/my-data rendered the stock layout (loggedInUser.defaultPersona = null in
every trace) and the widget-visibility assertions failed at
customizeLandingPage.ts:258.

Port the per-test testUser/persona fixtures from CustomizeWidgets (#31408):
the persona fixture attaches the persona and defaultPersona to the user via
API PATCH before login, so every test in any worker starts with the right
session, and per-test personas also remove the last-write-wins races on the
shared persona.<name> layout document.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(e2e): pass the KPI widget's layout key to waitForLandingPageWidget

DataInsight.spec.ts called waitForLandingPageWidget(page, 'kpi-widget'),
but kpi-widget is a child div of the widget - KPIWidget renders
KnowledgePanel.KPI on its WidgetWrapper and that is the key its
DeferredWidget slot is named after.

That worked only by accident: the old helper's loop blind-scrolled the
landing page on every iteration whether or not the key resolved, which
mounted the deferred widget and made the inner testid appear. The
rewritten helper only scrolls a locator it can resolve, so the inner
testid now reveals nothing and the widget never mounts - the spec failed
in playwright-ci-postgresql (chromium-01) with "getByTestId('kpi-widget')
element(s) not found".

Pass the layout key and assert the inner testid against the returned
locator, which also proves the widget's content rendered rather than just
locating a div. Document the contract on waitForLandingPageWidget so the
next caller does not repeat it. Audited every call site: this was the only
one passing an inner testid.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 2b11dda)
@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 Aug 15, 2026
@gitar-bot

gitar-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Cherry-picks CustomizeWidget and CustomizeLandingPage test fixes onto the 2.0 branch, improving test isolation and skeleton waits. Verify verifyDomainsFilters still uses the broken skeleton selector.

💡 Bug: verifyDomainsFilters still uses broken skeleton selector

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/widgetFilters.ts:239-253

The PR replaces the tag-name selector widget.locator('entity-list-skeleton') (which never matches any element, making the settle-wait a no-op) with widget.getByTestId('entity-list-skeleton') throughout widgetFilters.ts, but verifyDomainsFilters was missed and retains all three occurrences of the broken .locator('entity-list-skeleton') call. Those waits still resolve instantly against nothing, so domain filter assertions can race the widget's refetch. Update the three calls in verifyDomainsFilters to widget.getByTestId('entity-list-skeleton') to match the rest of the file.

Apply to all three skeleton waits inside verifyDomainsFilters, matching the fix used in the other filter helpers.
await widget.getByTestId('entity-list-skeleton').waitFor({
  state: 'detached',
});
🤖 Prompt for agents
Code Review: Cherry-picks CustomizeWidget and CustomizeLandingPage test fixes onto the 2.0 branch, improving test isolation and skeleton waits. Verify verifyDomainsFilters still uses the broken skeleton selector.

1. 💡 Bug: verifyDomainsFilters still uses broken skeleton selector
   Files: openmetadata-ui/src/main/resources/ui/playwright/utils/widgetFilters.ts:239-253

   The PR replaces the tag-name selector `widget.locator('entity-list-skeleton')` (which never matches any element, making the settle-wait a no-op) with `widget.getByTestId('entity-list-skeleton')` throughout widgetFilters.ts, but `verifyDomainsFilters` was missed and retains all three occurrences of the broken `.locator('entity-list-skeleton')` call. Those waits still resolve instantly against nothing, so domain filter assertions can race the widget's refetch. Update the three calls in `verifyDomainsFilters` to `widget.getByTestId('entity-list-skeleton')` to match the rest of the file.

   Fix (Apply to all three skeleton waits inside verifyDomainsFilters, matching the fix used in the other filter helpers.):
   await widget.getByTestId('entity-list-skeleton').waitFor({
     state: 'detached',
   });

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

❌ UI Checkstyle Failed

❌ Core Components - I18n Sync

Core-components t() keys, locale files, or language-set are out of sync. Run yarn check-i18n-all locally.

❌ Antd + Less Deprecation Guard

A new antd import or new .less file was added. Use UntitledUI + Tailwind for new work.

Affected files

at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
at Function._load (node:internal/modules/cjs/loader:1211:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {


Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit 4dc784551bfa0102b3cc9ed1fe153e8a6d789714 in Playwright run 31886518996, attempt 1.

✅ 656 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Pipeline and setup failures (1)

  • Playwright coverage validation found 0 missing, 1 unexpected, 0 duplicate-plan, and 0 duplicate-execution test ID(s).

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) 49m 50s

⏱️ Max setup 2m 53s · max shard execution 16m 40s · max shard-job elapsed before upload 19m 57s · reporting 9s

🌐 213.76 requests/attempt · 2.88 app boots/UI scenario · 33.60% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 33.6% (convergence target: at most 15%).
  • Browser traffic was 213.76 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.88 per UI scenario (2066 boots / 718 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 105 0 1 0 0 0
✅ Shard chromium-02 96 0 0 0 0 0
🟡 Shard chromium-03 103 0 1 0 0 0
✅ Shard chromium-04 98 0 0 0 0 0
✅ Shard chromium-05 104 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
🟡 Shard global-state-01 33 0 1 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 3 flaky test(s) (passed on retry)
  • Flow/CustomizeWidgets.spec.tsKPI Widget (shard chromium-01, 1 retry)
  • Pages/Entity.spec.tsDomain Propagation (shard chromium-03, 1 retry)
  • Pages/IntakeForm.spec.tsData Product serializes each custom-property type for the create API (shard global-state-01, 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

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.

1 participant