Skip to content

test(ui): Playwright coverage for CSV export jobs tray - #30883

Open
anuj-kumary wants to merge 5 commits into
open-metadata:mainfrom
anuj-kumary:playwright-entity-export-jobs-tray
Open

test(ui): Playwright coverage for CSV export jobs tray#30883
anuj-kumary wants to merge 5 commits into
open-metadata:mainfrom
anuj-kumary:playwright-entity-export-jobs-tray

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Aug 3, 2026

Copy link
Copy Markdown
Member

Describe your changes:

I added Playwright E2E coverage for the CSV export jobs tray, which previously only had Jest component coverage. This closes two gaps:

  1. Auto-open behaviour from Improve bulk export action stats #30615 — the tray now opens on its own when a background job reaches a terminal state. No Playwright test asserted this.
  2. Per-entity export → tray flow — the real Manage ▸ Export UI wiring was only tray-asserted for Metrics and dataAsset (Explore). The other export surfaces went through the API and deliberately suppressed the tray.

Type of change:

  • Improvement (test coverage)

High-level design:

CsvJobsTray.spec.ts (+4 tests): tray auto-opens on export completion, auto-opens on import failure, does not surface a job already terminal on initial load, and does not re-open a terminal job after the user minimizes it.

EntityExportJobsTray.spec.ts (new, 5 tests): drives the real Manage ▸ Export button for Database Service, Database, Database Schema, Table, and Glossary and asserts the job surfaces in the tray.

The tray is a global, user-scoped widget and every CI worker runs as the same admin, so a real export job would leak across parallel tests. These specs are therefore hermetic and fully independent in both directions:

  • exportAsync is stubbed to return a job object (still exercises the real button + runTrayExport refresh dispatch) so no real backend job is created → nothing leaks out to other workers.
  • csvAsyncJobs is mocked page-scoped so the tray shows only this test's synthetic job → nothing leaks in.

Both routes are page-scoped and cannot affect any other running test.

Tests:

Use cases covered

  • Export/import jobs tray auto-opens when a job completes or fails
  • A finished job from a previous session is not re-surfaced on load
  • Minimizing an auto-opened tray does not make it pop back open
  • Manage ▸ Export on Database Service / Database / Schema / Table / Glossary surfaces the job in the tray

Notes

  • Test-only change; no product code touched.
  • Verified locally: ESLint (eslint-plugin-playwright), Prettier, organize-imports, and tsc all clean; no forbidden Playwright patterns (.only, networkidle, page.pause, force:true).

🤖 Generated with Claude Code


Summary by Gitar

  • UI & Component Migration:
    • Migrated query builder components from @react-awesome-query-builder/antd to @react-awesome-query-builder/ui
    • Added core component query builder wrappers including OMFieldSelect, OMSelectWidget, OMMultiSelectWidget, and OMDateWidget
  • Bug Fixes:
    • Fixed real bugs in the query builder and advanced search modules during the AntD to core UI migration

This will update automatically on new commits.

@anuj-kumary
anuj-kumary requested review from a team, chirag-madlani and karanh37 as code owners August 3, 2026 15:53
@github-actions

github-actions Bot commented Aug 3, 2026

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 Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

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!

Cover the auto-open behaviour introduced in open-metadata#30615 and the per-entity
export -> tray flow, which previously had only Jest component coverage.

CsvJobsTray.spec.ts:
- tray auto-opens when an export job completes
- tray auto-opens when an import job fails
- a job already terminal on initial load is not surfaced
- a terminal job does not re-open the tray after the user minimizes it

EntityExportJobsTray.spec.ts (new): the real Manage -> Export flow for
Database Service, Database, Database Schema, Table and Glossary surfaces
the job in the tray. Hermetic: exportAsync is stubbed (no real backend
job -> nothing leaks to other parallel admin workers) and csvAsyncJobs is
mocked page-scoped (tray shows only this test's job), so the specs run
fully independently of every other test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@anuj-kumary
anuj-kumary force-pushed the playwright-entity-export-jobs-tray branch from 8e71ad1 to 4f180b1 Compare August 3, 2026 15:56
@github-actions

github-actions Bot commented Aug 3, 2026

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!

@anuj-kumary anuj-kumary self-assigned this Aug 3, 2026
@anuj-kumary anuj-kumary added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check To release Will cherry-pick this PR into the release branch labels Aug 3, 2026
@github-actions github-actions Bot removed the safe to test Add this label to run secure Github workflows on PRs label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

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!

@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Aug 3, 2026
@github-actions github-actions Bot removed the safe to test Add this label to run secure Github workflows on PRs label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

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!

@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Aug 3, 2026
@github-actions github-actions Bot removed the safe to test Add this label to run secure Github workflows on PRs label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

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

github-actions Bot commented Aug 4, 2026

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!

@gitar-bot

gitar-bot Bot commented Aug 4, 2026

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

Adds comprehensive Playwright E2E coverage for the CSV export jobs tray with isolated stubs, addressing the OMSelectWidget caches static options, ignores field change finding. No issues found.

✅ 1 resolved
Bug: OMSelectWidget caches static options, ignores field change

📄 openmetadata-ui/src/main/resources/ui/src/utils/queryBuilderWidgets/OMSelectWidget.tsx:49-50 📄 openmetadata-ui/src/main/resources/ui/src/utils/queryBuilderWidgets/OMSelectWidget.tsx:112-125
In OMSelectWidget the static (non-async) branch initializes items via useState(staticItems) and only ever calls setItems from the async fetch path, so listValues derived options are snapshotted on mount. If RAQB reuses the same widget instance when the rule's field changes (the exact scenario OMMultiSelectWidget documents and guards against by deriving options from props each render), the static dropdown will keep showing the previous field's options. Derive the static options directly from props (e.g. const allItems = isAsync ? asyncItems : staticItems;) so a field switch reflects the new listValues, matching the multiselect widget's handling.

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

skip-pr-checks Bypass PR metadata validation check To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants