Repository navigation
test(ui): Playwright coverage for CSV export jobs tray - #30883
anuj-kumary wants to merge 5 commits into
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
8e71ad1 to
4f180b1
Compare
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
2 similar comments
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
020e10b to
6aae6ec
Compare
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…tJobsTray spec - impact-map.json: map CsvJobsTray/EntityExportModalProvider/csvAPI sources to both spec files so source-file PRs trigger the right Playwright coverage. Delegate EntityExportJobsTray.spec.ts so stale-baseline gate does not fire when only the spec itself changes. - EntityExportJobsTray.spec.ts (new): hermetic E2E test for the Manage → Export → jobs-tray flow across Database Service, Database, Schema, Table and Glossary entities. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ion tests
Remove all page.route() mocking per reviewer feedback. Tests now create genuine
export jobs via the Explore UI, poll /csvAsyncJobs with performAdminLogin for
auth, and run serially to prevent job-list contamination.
Add data-testid="csv-jobs-tray-item-{jobId}" to each tray item so assertions
can scope to the specific job each test created — parallel workers sharing the
admin user's job list cannot interfere with scoped selectors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…verrun All 5 tests are new (no-mock rewrite changed every test name) so timing- baseline.json has no history for them. Without delegation the planner falls back to FALLBACK_TEST_MS and under-budgets the shard, reproducing the chromium-12 SIGTERM from run 30716060441 (PR open-metadata#30812). Same treatment as EntityExportJobsTray.spec.ts: delegated specs are excluded from targeted PR plans but still run in full-mode nightly builds (where they will seed real durations into the baseline) and via the source-file mapping whenever CsvJobsTray, EntityExportModalProvider, or csvAPI changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Drop stubExportAsync and mockCsvJobsPolling (both page.route() intercepts).
Tests now hit the real backend: the export response returns the real jobId,
and tray assertions are scoped to [data-testid="csv-jobs-tray-item-{jobId}"]
so parallel workers sharing the admin user cannot interfere.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| page.locator(`[data-testid="csv-jobs-tray-item-${jobId}"]`) | ||
| ).toBeVisible({ timeout: 30_000 }); | ||
|
|
||
| await expect(page.getByText(/Exporting/i).first()).toBeVisible(); |
There was a problem hiding this comment.
⚠️ Edge Case: 'Exporting' text assertion is flaky against real fast exports
This commit drops the mocked RUNNING job and drives real backend exports. The tray only renders 'Exporting…' while job.status !== 'COMPLETED'; a terminal job shows 'Exported…'. The test entities are tiny so the export almost always reaches COMPLETED before the first poll picks it up, at which point page.getByText(/Exporting/i) no longer matches ('Exported' does not contain 'Exporting') and the assertion fails. Assert on the job item presence (already scoped by csv-jobs-tray-item-${jobId}) and match either state, e.g. getByText(/Export(ing|ed)/i), or drop the transient-state text check entirely.
Was this helpful? React with 👍 / 👎
| const jobId = await triggerDataAssetExport(page); | ||
| await assertExportJobInTray(page, jobId); |
There was a problem hiding this comment.
💡 Edge Case: Real export jobs now leak into the shared admin tray
Removing the exportAsync/csvAsyncJobs stubs means each test creates a real, persistent job under the shared admin user, and the deleted entity in finally does not remove the job from the user-scoped tray. Positive assertions are safely scoped by jobId, but the unscoped getByText(/Exporting/i).first() can match a concurrent worker's job, and accumulated jobs from prior/parallel tests remain in the tray. Consider scoping the state-text assertion within the csv-jobs-tray-item-${jobId} locator so it cannot pick up another worker's job.
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source



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:
Type of change:
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:
exportAsyncis stubbed to return a job object (still exercises the real button +runTrayExportrefresh dispatch) so no real backend job is created → nothing leaks out to other workers.csvAsyncJobsis 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
Notes
eslint-plugin-playwright), Prettier, organize-imports, andtscall clean; no forbidden Playwright patterns (.only,networkidle,page.pause,force:true).🤖 Generated with Claude Code
Summary by Gitar
HeaderShelland updated breadcrumb layout inWorkflowBuilder.This will update automatically on new commits.