Skip to content

Chore(UI): Fix the CustomizeWidget CustomizeLandingPage tests - #31551

Merged
aniketkatkar97 merged 6 commits into
mainfrom
fix-customizeWidget-tests
Aug 15, 2026
Merged

Chore(UI): Fix the CustomizeWidget CustomizeLandingPage tests#31551
aniketkatkar97 merged 6 commits into
mainfrom
fix-customizeWidget-tests

Conversation

@aniketkatkar97

@aniketkatkar97 aniketkatkar97 commented Aug 14, 2026

Copy link
Copy Markdown
Member

This pull request refactors the landing page widget test utilities in customizeLandingPage.ts to improve reliability and clarity when interacting with deferred (lazy-loaded) widgets. The main changes focus on robustly revealing, asserting, and verifying the presence or absence of widgets that may not be immediately present in the DOM due to deferred rendering.

Improvements to widget detection and interaction:

  • Added getLandingPageWidgetSlot to accurately locate widget slots by matching both exact and suffixed layout keys, handling cases where widgets are added dynamically and may have unique IDs.
  • Introduced revealLandingPageWidget to ensure that widgets are scrolled into view only if their slot or widget DOM node is present, preventing unnecessary or stalled scroll actions.

Simplification and reliability of widget visibility checks:

  • Refactored isLandingPageWidgetVisible to use revealLandingPageWidget and a direct visibility assertion, removing manual scrolling and polling logic for more reliable checks.
  • Updated waitForLandingPageWidget to always reveal the widget before asserting its visibility and waiting for any skeleton loaders to disappear, ensuring that loading is complete before proceeding.

Correctness of widget removal assertions:

  • Changed removeAndVerifyWidget to assert on the absence of the deferred slot rather than the widget itself, ensuring that the test correctly distinguishes between a widget being removed and merely being out of view (deferred).

Test flow improvements:

  • Simplified addAndVerifyWidget to rely on waitForLandingPageWidget for web-first assertions, removing redundant polling and making the flow more straightforward and reliable.
Screenshot 2026-08-14 at 9 00 01 PM

@aniketkatkar97 aniketkatkar97 self-assigned this Aug 14, 2026
Copilot AI lite review requested due to automatic review settings August 14, 2026 15:31

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 Aug 14, 2026
Copilot AI review requested due to automatic review settings August 14, 2026 15:49

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

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 1a16bbf9ae998950498a13f93a05d89a24833e06 in Playwright run 31881734404, attempt 1.

✅ 657 passed · ❌ 0 failed · 🟡 2 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) 37m 39s

⏱️ Max setup 3m 9s · max shard execution 19m 38s · max shard-job elapsed before upload 23m 5s · reporting 6s

🌐 220.96 requests/attempt · 2.90 app boots/UI scenario · 11.71% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 220.96 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.9 per UI scenario (2030 boots / 699 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 133 0 0 0 0 0
✅ Shard chromium-02 127 0 0 0 0 0
🟡 Shard chromium-03 120 0 1 0 0 0
✅ Shard chromium-04 127 0 0 0 0 0
🟡 Shard data-asset-rules-01 60 0 1 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 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
🟡 2 flaky test(s) (passed on retry)
  • Flow/CustomizeWidgets.spec.tsKPI Widget (shard chromium-03, 1 retry)
  • Features/DataAssetRulesDisabled.spec.tsVerify the MlModel entity item action after rules disabled (shard data-asset-rules-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

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Aug 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-15T05:29:15Z)

Blocked the queue: playwright-summary

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Aug 15, 2026
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>
Copilot AI review requested due to automatic review settings August 15, 2026 11:19

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.

@aniketkatkar97
aniketkatkar97 added this pull request to the merge queue Aug 15, 2026
Merged via the queue into main with commit 2b11dda Aug 15, 2026
86 of 87 checks passed
@aniketkatkar97
aniketkatkar97 deleted the fix-customizeWidget-tests branch August 15, 2026 13:09
@gitar-bot

gitar-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Refactors landing page widget test utilities and isolation to fix flaky E2E tests for CustomizeWidget and CustomizeLandingPage. The revealLandingPageWidget scroll error handling finding was successfully addressed.

✅ 1 resolved
Edge Case: revealLandingPageWidget scroll no longer swallows errors

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/customizeLandingPage.ts:56-70 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/customizeLandingPage.ts:232
The old scroll helpers all wrapped scroll actions in .catch(() => undefined), tolerating transient failures. revealLandingPageWidget calls slot.scrollIntoViewIfNeeded() / widget.scrollIntoViewIfNeeded() without a catch, and it runs inside isLandingPageWidgetVisible, which is invoked from expect.poll callbacks in verifyDomainCountInDomainWidget/verifyDataProductCountInDataProductWidget. If the element detaches between the count() check and the scroll (or the scroll times out), the thrown error propagates out of the poll callback and fails the whole test instead of retrying — the flakiness the original catches guarded against. Consider .catch(() => undefined) on the scrollIntoViewIfNeeded calls to preserve that resilience.

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

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.

3 participants