Skip to content

fix(playwright): markdown preview and KPI Widget locators on Collate - #35631

Open
Rohit0301 wants to merge 8 commits into
mainfrom
Rohit0301/markdown-kpi-fix
Open

Rohit0301 wants to merge 8 commits into
mainfrom
Rohit0301/markdown-kpi-fix

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes the failing ContextCenterFilePreview › markdown file renders as formatted markdown in the preview modal and CustomizeWidgets › KPI Widget Playwright tests on Collate.

  • Markdown preview: fix(ui): Context Center dark-mode surfaces and text colors #35357 intentionally switched MarkdownRenderer from tw:prose to the themed prose class, so the [class*="tw:prose"] locator found nothing. Added data-testid="markdown-preview" to the markdown container and the test now asserts the heading inside it, instead of relying on a class name.
  • KPI Widget: Migrate display, navigation, selection and numeric components to core #35253 changed OM's Data Insight left panel to links and the specs to getByRole('link', { name: 'KPIs' }), but Collate overrides that panel (DataInsightClassCollate.getLeftPanel()) with role="menuitem" buttons, so the click timed out. Both panels now carry data-testid="data-insight-tab-<key>" (Collate: open-metadata/openmetadata-collate#7559), and a new openDataInsightTab(page, tab) helper in playwright/utils/dataInsight.ts clicks it and waits for /data-insights/<tab>. Used in CustomizeWidgets.spec.ts and DataInsight.spec.ts (4 KPI steps plus the App Analytics tab, which had the same link-only locator).

Merge order: open-metadata/openmetadata-collate#7559 first, or Collate CI won't find the test id.

Type of change:

  • Bug fix

High-level design:

N/A — small test-only change.

Tests:

Use cases covered

  • Markdown file preview modal renders the markdown heading inside the themed prose container
  • Navigating to the Data Insight KPIs and App Analytics tabs works with both the OM (link) and Collate (menuitem) left panel

Unit tests

Not applicable — Playwright-only change.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Files updated: src/components/common/FilePreviewer/MarkdownRenderer.tsx (test id), src/pages/DataInsightPage/DataInsightLeftPanel/DataInsightLeftPanel.tsx (test id), playwright/e2e/nightly/ContextCenterFilePreview.spec.ts, playwright/e2e/Flow/CustomizeWidgets.spec.ts, playwright/e2e/Pages/DataInsight.spec.ts, playwright/utils/dataInsight.ts
  • Ran against a local Collate server (:8585), each test individually, 10 sequential runs with --workers=3 (entity-data-setup seeded once beforehand, not part of the runs):
    • CustomizeWidgets.spec.ts › KPI Widget — 10/10 passed (17.8s–19.9s)
    • ContextCenterFilePreview.spec.ts › markdown file renders as formatted markdown in the preview modal — 10/10 passed (3.8s–4.3s)
  • After the test-id change, against dev UIs on the same local Collate backend:
    • Collate UI (with openmetadata-collate#7559 + this branch mirrored in): KPI Widget 10/10 (run on its own, 10 sequential runs, --workers=3), DataInsight.spec.ts 10/10
    • OpenMetadata UI: KPI Widget 10/10, DataInsight.spec.ts 10/10
    • ContextCenterFilePreview › markdown file renders… with the markdown-preview test id: 10/10 on the OpenMetadata UI
  • ESLint + Prettier clean on changed files.

Merged Playwright report — 20/20 passed

Manual testing performed

  1. Inspected the failing CI traces: the Collate Data Insight left panel renders <ul role="menu"> with <button role="menuitem">KPIs</button>; the markdown preview renders <div class="prose tw:max-w-none tw:p-4">.
  2. Ran both specs locally against Collate as above.

UI screen recording:

Not applicable — test-only fix, no product UI change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — test fix, no issue (labelled skip-pr-checks)
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above. — test fix, no issue
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: N/A
  • For a UI feature or feature task: N/A
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Decision check: no durable decision.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge with the documented Collate merge order.

Summary

Replaces brittle Playwright locators with stable test IDs.

  • Markdown preview tests find content through a stable container.
  • Data Insight tests open KPI and analytics tabs across both panel styles.
  • The generated test impact map includes the profiler ingestion form.

No actionable issues found. Tests were not run during this review.

Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/Roh..." · Reviewed by Greptile

- ContextCenterFilePreview: the markdown preview now uses the themed
  `prose` class (#35357), so assert the heading inside `.prose`
- Add openKpiTab helper that clicks the KPIs entry as a link (OpenMetadata)
  or a menuitem (Collate's overridden Data Insight left panel); use it in
  CustomizeWidgets and DataInsight specs
@Rohit0301 Rohit0301 added the skip-pr-checks Bypass PR metadata validation check label Oct 16, 2026
@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 the UI UI specific issues label Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 936 → 937
- 1 added, 0 removed, 11 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/QualityTab/QualityTab.component.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/e2e/fixtures/pages.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/entity/TableClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/entity/service/DatabaseServiceClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/admin.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/apiResponse.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/scopedLocators.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/testCases.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/waitHelpers.ts
  … and 1 more

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Rohit0301 Rohit0301 added safe to test Add this label to run secure Github workflows on PRs and removed skip-pr-checks Bypass PR metadata validation check labels Oct 16, 2026
@Rohit0301 Rohit0301 self-assigned this Oct 16, 2026

await expect(
modal.getByRole('heading', { name: MARKDOWN_HEADING })
modal.locator('.prose').getByRole('heading', { name: MARKDOWN_HEADING })

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We are not encouraging locator can we prefer dataTestId instead

Comment on lines +122 to +123
.getByRole('link', { name: 'KPIs', exact: true })
.or(panel.getByRole('menuitem', { name: 'KPIs', exact: true }))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why we need or here?

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 78%
78.59% (129937/165318) 65.36% (82635/126430) 66.7% (27611/41391)

Rohit0301 and others added 2 commits October 18, 2026 00:39
…role

Add data-insight-tab-<key> to the Data Insight left panel and replace
the link-or-menuitem locator with openDataInsightTab(page, tab), also
used for the App Analytics tab. Collate adds the same test id to its
overridden panel (openmetadata-collate#7559).
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 937 → 989
- 52 added, 0 removed, 13 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/SearchedData/SearchedData.interface.ts
  openmetadata-ui/src/main/resources/ui/src/enums/DataInsight.enum.ts
  openmetadata-ui/src/main/resources/ui/src/generated/analytics/reportData.ts
  openmetadata-ui/src/main/resources/ui/src/generated/dataInsight/dataInsightChart.ts
  openmetadata-ui/src/main/resources/ui/src/generated/dataInsight/dataInsightChartResult.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/ai/aiApplication.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/ai/llmModel.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/ai/mcpServer.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/classification/tag.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/apiCollection.ts
  … and 42 more

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/Explore/SortingDropDown.tsx
  openmetadata-ui/src/main/resources/ui/src/enums/common.enum.ts
  openmetadata-ui/src/main/resources/ui/src/enums/search.enum.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/apiEndpoint.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/container.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/dataContract.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/file.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/query.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/searchIndex.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/topic.ts
  … and 3 more

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 1 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 1 warning(s) across 1 changed file(s).

Count Rule
1 openmetadata-imports/no-circular-imports
All findings
Location Rule Message
🟡 src/pages/DataInsightPage/DataInsightLeftPanel/DataInsightLeftPanel.tsx:21:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.

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

make ui-checkstyle-changed

…Insight helper

lint:playwright only allows src/generated and src/enums imports, so
openDataInsightTab takes the tab key as a string-literal type.
… Rohit0301/markdown-kpi-fix

# Conflicts:
#	.github/playwright/impact-map.generated.json
@gitar-bot

gitar-bot Bot commented Oct 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟢 Low risk · Adding test IDs and updating Playwright locators is limited to test targeting, with no meaningful change to application behavior or interfaces.

Replaces brittle Playwright locators for the markdown preview and Data Insight KPI/App Analytics tabs with stable data-testid attributes and a shared openDataInsightTab helper. No issues found; the Collate companion change (openmetadata-collate#7559) must merge first.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@sonarqubecloud

Copy link
Copy Markdown

@chirag-madlani
chirag-madlani added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-18T14:28:47Z)

Blocked the queue: playwright-summary

Failed Playwright tests:

  • Flow/NotificationAlerts.spec.ts › Multiple Filters Alert

@Rohit0301
Rohit0301 added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-18T15:46:51Z)

Blocked the queue: playwright-summary

Failed Playwright tests:

  • Flow/NotificationAlerts.spec.ts › Multiple Filters Alert

@Rohit0301
Rohit0301 added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-18T19:57:04Z)

Blocked the queue: playwright-summary

Failed Playwright tests:

  • Pages/Lineage/LineageInteraction.spec.ts › platform lineage is view only in every band

This branch has not been deployed

No deployments
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