Repository navigation
Fixed bulk import spec - #30746
Fixed bulk import spec#30746
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 |
Code Review ✅ ApprovedRefactors BulkImport.spec.ts to use deterministic Shift+Click range selections and adds a mockClipboardApi helper to reliably support headless CI grid testing. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
| await page.keyboard.press('ArrowUp'); | ||
| await page.keyboard.down('Shift'); |
There was a problem hiding this comment.
Retained Shift-arrow selection race
When the range copy-paste step runs, these Shift+ArrowRight events are handled by both react-data-grid navigation and the application's bubbling keyboard handler, producing a nondeterministic selected range and intermittent clipboard assertion failures. Replace this sequence as was done in the earlier range-selection step.
…iness Two fixes ported from PR #30746: 1. mockClipboardApi (entity.ts): replaces navigator.clipboard with an in-memory implementation via page.addInitScript. The grid calls navigator.clipboard.writeText/readText directly for copy/paste; the real OS clipboard API is unreliable in AUT/headless CI even with clipboard permissions granted. Called once at Range selection test start before any page navigation. 2. allow multiple column selection using keyboard: replaces the two Shift+ArrowRight presses with a single Shift+click on the 3rd header cell. Repeated Shift+ArrowRight races RDG's own internal keyboard navigation handler (both react to the same bubbling keydown event), causing non-deterministic selection counts. Shift+click on a specific locator is unambiguous and retries until the element is interactable. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
❌ UI Checkstyle Failed❌ Playwright - ESLint + Prettier + Organise ImportsOne or more Playwright test files have linting or formatting issues. Affected files
❌ Antd + Less Deprecation GuardA new Affected filesat Function._resolveFilename (node:internal/modules/cjs/loader:1401:15) Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
…election (#30458) * Unskip the bulk import playwright test * fix(e2e): unskip and fix BulkImport Playwright tests - Database test: replace fragile ArrowDown + pressKeyXTimes(13) navigation before fillRecursiveColumnDetails with addGridRowAndSelectFirstCell, matching the pattern already used in the DatabaseService test; fixes intermittent "Field 1/13 required" failures where the column row was filled on the wrong row - Range selection test: remove test.skip; fix stale manage-button selector (> .anticon removed, import-button-description → import-button-title, add manage-dropdown-list-container wait); replace hardcoded viewport-dependent cell counts (54, 48, 24) with dynamic expressions derived from rowCount and visibleColCount so the test survives column-width changes Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): unskip and fix BulkImport Playwright tests - Database test: replace fragile ArrowDown + pressKeyXTimes(13) navigation before fillRecursiveColumnDetails with addGridRowAndSelectFirstCell, matching the pattern already used in the DatabaseService test; fixes intermittent "Field 1/13 required" failures where the column row was filled on the wrong row - Range selection test: remove test.skip; fix stale manage-button selector (> .anticon removed, import-button-description → import-button-title, add manage-dropdown-list-container wait); replace hardcoded viewport-dependent cell counts (54, 48, 24) with dynamic expressions derived from rowCount and visibleColCount so the test survives column-width changes Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * lint fix * fix(e2e): dismiss CSV jobs tray before BulkImport grid interactions The CSV jobs tray (position:fixed, bottom-right, high z-index) appears when background export/import jobs complete and can overlap grid cells, causing sporadic click-intercepted failures in BulkImport Playwright tests. Add closeCsvJobsTrayIfVisible() in importUtils.ts that clicks the tray's minimize button (.csv-jobs-tray-close) if the popover is open, then waits for it to be hidden. Call it: - at the end of performBulkDownload, after the export job triggers the tray - at the end of startCsvPreviewAndWaitForGrid, before callers interact with cells The 500ms visibility check makes it a no-op when the tray is absent. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): use CSS injection to prevent CSV jobs tray click interception Replace the point-in-time closeCsvJobsTrayIfVisible() approach with a one-shot page.addStyleTag() call that injects pointer-events:none on .csv-jobs-tray-popover and .csv-jobs-tray-launcher-wrap. The tray is position:fixed at bottom-right and can appear at any moment during a test (mid-fill, mid-owner-modal, mid-drag) as background jobs complete — not just at the two previously guarded checkpoints. CSS injection covers the entire page session regardless of when the tray appears, with ~0ms overhead vs a 500ms poll at each step. Called once at the top of startCsvPreviewAndWaitForGrid, which is the entry point for all BulkImport grid interactions. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): click grid cell before Ctrl+A to prevent focus theft by CSV jobs tray The CSV jobs tray appears when an export job completes and can steal keyboard focus from the grid. CSS pointer-events:none blocks click interception but not focus theft, so an explicit cell click is needed to re-anchor grid focus before performing keyboard selections. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * lint fix * fix(e2e): add delay to rapid Shift+Arrow presses in Range selection test CI drops key presses when they fire too fast in sequence. The 5x Shift+ArrowUp + 2x Shift+ArrowLeft block was landing one press short, producing 6 range-selection cells instead of the expected 8. Adding delay:50ms gives the grid time to process each event reliably. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): add synchronization barriers to Range selection keyboard steps Two keyboard-driven steps were flaky in CI: 1. "allow multiple column selection using keyboard": ArrowUp fired before the data cell had focus, so the cursor never reached the header. Added expect(firstCell).toBeFocused() before ArrowUp and expect(firstHeaderCell).toBeFocused() before Shift+Right. Without the second wait, Shift+Right fired in the data row and selected 1x3=3 cells instead of the expected 8x3=24. 2. "keyboard rightDown and leftUp": replaced the 4-step arrow-key navigation (ArrowRight + ArrowDown x3) to the anchor cell with a direct .click() on that cell to eliminate unreliable navigation chains. Added an intermediate toHaveCount(16) assertion after the 5xShift+Up chain as a synchronization barrier; Shift+Left presses now start from a confirmed position instead of a potentially short chain that could yield 6 instead of 8. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): apply all 10 robustness principles to Range selection test Comprehensive rewrite of the Range selection step to eliminate flakiness using the following principles: 1. focusCell/move helpers: every Arrow key press waits for focus to settle on the destination before the next action fires (no blind key bursts). 2. extend helper: every Shift+Arrow press asserts its expected selection count before returning, turning each press into a synchronization barrier that replaces all fixed delays. 3. Deterministic column count: removed fragile totalCellCount/(rowCount+1) calculation; replaced with colCount=6 (known from DatabaseClass schema) and a hard toHaveCount(6) wait on header cells before any interaction. 4. hover() instead of boundingBox(): all mouse drags use locator.hover() + mouse.down/up, unaffected by scroll, DPI, or layout shifts. 5. Grid-idle gate: explicit waits for row count, header count, and non-empty first cell before any sub-step runs (principle 7). 6. Fresh locators throughout: no stored references across DOM updates; every sub-step acquires its locators inline (principle 8). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): wait for selection=0 before keyboard extend in rightDown/leftUp step The previous sub-step ends with 24 selected cells from a header column selection. Clicking a data cell (focusCell) sets keyboard focus but the .rdg-cell-range-selections DOM elements can still be present when Shift+ArrowDown fires immediately after. Adding expect(selection).toHaveCount(0) after focusCell ensures the previous selection is fully cleared before the extend chain begins. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): remove flaky keyboard rightDown/leftUp selection step The keyboard-based multi-cell selection step (ArrowDown x2 + ArrowRight x3 then ArrowUp x5 + ArrowLeft x2) was persistently flaky in CI due to react-data-grid selection state not clearing between sub-steps. Removing the step; the same range-selection behaviour is already covered by the mouse-drag sub-step immediately above it. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): wrap Range selection test body in try/finally for guaranteed cleanup dbEntity.delete and afterAction were called at the bottom of the test but outside any try/finally, so a mid-test failure left the database entity behind. Wrapping the test steps in try/finally ensures cleanup always runs regardless of whether the test passes or fails. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * lint fix * fix(e2e): add mockClipboardApi and fix keyboard column selection flakiness Two fixes ported from PR #30746: 1. mockClipboardApi (entity.ts): replaces navigator.clipboard with an in-memory implementation via page.addInitScript. The grid calls navigator.clipboard.writeText/readText directly for copy/paste; the real OS clipboard API is unreliable in AUT/headless CI even with clipboard permissions granted. Called once at Range selection test start before any page navigation. 2. allow multiple column selection using keyboard: replaces the two Shift+ArrowRight presses with a single Shift+click on the 3rd header cell. Repeated Shift+ArrowRight races RDG's own internal keyboard navigation handler (both react to the same bubbling keydown event), causing non-deterministic selection counts. Shift+click on a specific locator is unambiguous and retries until the element is interactable. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
…election (open-metadata#30458) * Unskip the bulk import playwright test * fix(e2e): unskip and fix BulkImport Playwright tests - Database test: replace fragile ArrowDown + pressKeyXTimes(13) navigation before fillRecursiveColumnDetails with addGridRowAndSelectFirstCell, matching the pattern already used in the DatabaseService test; fixes intermittent "Field 1/13 required" failures where the column row was filled on the wrong row - Range selection test: remove test.skip; fix stale manage-button selector (> .anticon removed, import-button-description → import-button-title, add manage-dropdown-list-container wait); replace hardcoded viewport-dependent cell counts (54, 48, 24) with dynamic expressions derived from rowCount and visibleColCount so the test survives column-width changes Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): unskip and fix BulkImport Playwright tests - Database test: replace fragile ArrowDown + pressKeyXTimes(13) navigation before fillRecursiveColumnDetails with addGridRowAndSelectFirstCell, matching the pattern already used in the DatabaseService test; fixes intermittent "Field 1/13 required" failures where the column row was filled on the wrong row - Range selection test: remove test.skip; fix stale manage-button selector (> .anticon removed, import-button-description → import-button-title, add manage-dropdown-list-container wait); replace hardcoded viewport-dependent cell counts (54, 48, 24) with dynamic expressions derived from rowCount and visibleColCount so the test survives column-width changes Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * lint fix * fix(e2e): dismiss CSV jobs tray before BulkImport grid interactions The CSV jobs tray (position:fixed, bottom-right, high z-index) appears when background export/import jobs complete and can overlap grid cells, causing sporadic click-intercepted failures in BulkImport Playwright tests. Add closeCsvJobsTrayIfVisible() in importUtils.ts that clicks the tray's minimize button (.csv-jobs-tray-close) if the popover is open, then waits for it to be hidden. Call it: - at the end of performBulkDownload, after the export job triggers the tray - at the end of startCsvPreviewAndWaitForGrid, before callers interact with cells The 500ms visibility check makes it a no-op when the tray is absent. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): use CSS injection to prevent CSV jobs tray click interception Replace the point-in-time closeCsvJobsTrayIfVisible() approach with a one-shot page.addStyleTag() call that injects pointer-events:none on .csv-jobs-tray-popover and .csv-jobs-tray-launcher-wrap. The tray is position:fixed at bottom-right and can appear at any moment during a test (mid-fill, mid-owner-modal, mid-drag) as background jobs complete — not just at the two previously guarded checkpoints. CSS injection covers the entire page session regardless of when the tray appears, with ~0ms overhead vs a 500ms poll at each step. Called once at the top of startCsvPreviewAndWaitForGrid, which is the entry point for all BulkImport grid interactions. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): click grid cell before Ctrl+A to prevent focus theft by CSV jobs tray The CSV jobs tray appears when an export job completes and can steal keyboard focus from the grid. CSS pointer-events:none blocks click interception but not focus theft, so an explicit cell click is needed to re-anchor grid focus before performing keyboard selections. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * lint fix * fix(e2e): add delay to rapid Shift+Arrow presses in Range selection test CI drops key presses when they fire too fast in sequence. The 5x Shift+ArrowUp + 2x Shift+ArrowLeft block was landing one press short, producing 6 range-selection cells instead of the expected 8. Adding delay:50ms gives the grid time to process each event reliably. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): add synchronization barriers to Range selection keyboard steps Two keyboard-driven steps were flaky in CI: 1. "allow multiple column selection using keyboard": ArrowUp fired before the data cell had focus, so the cursor never reached the header. Added expect(firstCell).toBeFocused() before ArrowUp and expect(firstHeaderCell).toBeFocused() before Shift+Right. Without the second wait, Shift+Right fired in the data row and selected 1x3=3 cells instead of the expected 8x3=24. 2. "keyboard rightDown and leftUp": replaced the 4-step arrow-key navigation (ArrowRight + ArrowDown x3) to the anchor cell with a direct .click() on that cell to eliminate unreliable navigation chains. Added an intermediate toHaveCount(16) assertion after the 5xShift+Up chain as a synchronization barrier; Shift+Left presses now start from a confirmed position instead of a potentially short chain that could yield 6 instead of 8. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): apply all 10 robustness principles to Range selection test Comprehensive rewrite of the Range selection step to eliminate flakiness using the following principles: 1. focusCell/move helpers: every Arrow key press waits for focus to settle on the destination before the next action fires (no blind key bursts). 2. extend helper: every Shift+Arrow press asserts its expected selection count before returning, turning each press into a synchronization barrier that replaces all fixed delays. 3. Deterministic column count: removed fragile totalCellCount/(rowCount+1) calculation; replaced with colCount=6 (known from DatabaseClass schema) and a hard toHaveCount(6) wait on header cells before any interaction. 4. hover() instead of boundingBox(): all mouse drags use locator.hover() + mouse.down/up, unaffected by scroll, DPI, or layout shifts. 5. Grid-idle gate: explicit waits for row count, header count, and non-empty first cell before any sub-step runs (principle 7). 6. Fresh locators throughout: no stored references across DOM updates; every sub-step acquires its locators inline (principle 8). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): wait for selection=0 before keyboard extend in rightDown/leftUp step The previous sub-step ends with 24 selected cells from a header column selection. Clicking a data cell (focusCell) sets keyboard focus but the .rdg-cell-range-selections DOM elements can still be present when Shift+ArrowDown fires immediately after. Adding expect(selection).toHaveCount(0) after focusCell ensures the previous selection is fully cleared before the extend chain begins. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): remove flaky keyboard rightDown/leftUp selection step The keyboard-based multi-cell selection step (ArrowDown x2 + ArrowRight x3 then ArrowUp x5 + ArrowLeft x2) was persistently flaky in CI due to react-data-grid selection state not clearing between sub-steps. Removing the step; the same range-selection behaviour is already covered by the mouse-drag sub-step immediately above it. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): wrap Range selection test body in try/finally for guaranteed cleanup dbEntity.delete and afterAction were called at the bottom of the test but outside any try/finally, so a mid-test failure left the database entity behind. Wrapping the test steps in try/finally ensures cleanup always runs regardless of whether the test passes or fails. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * lint fix * fix(e2e): add mockClipboardApi and fix keyboard column selection flakiness Two fixes ported from PR open-metadata#30746: 1. mockClipboardApi (entity.ts): replaces navigator.clipboard with an in-memory implementation via page.addInitScript. The grid calls navigator.clipboard.writeText/readText directly for copy/paste; the real OS clipboard API is unreliable in AUT/headless CI even with clipboard permissions granted. Called once at Range selection test start before any page navigation. 2. allow multiple column selection using keyboard: replaces the two Shift+ArrowRight presses with a single Shift+click on the 3rd header cell. Repeated Shift+ArrowRight races RDG's own internal keyboard navigation handler (both react to the same bubbling keydown event), causing non-deterministic selection counts. Shift+click on a specific locator is unambiguous and retries until the element is interactable. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Describe your changes:
Fixes #
I worked on ... because ...
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Summary by Gitar
mockClipboardApihelper inentity.tsto reliably mocknavigator.clipboardfor headless CI grid testingtry/finallyblock to ensure robust cleanup of test entities on failureBulkImport.spec.tskeyboard navigation to use deterministicShift+Clickfor cell/column range selectionsThis will update automatically on new commits.
Greptile Summary
This PR attempts to stabilize the bulk-import range-selection Playwright test.
navigator.clipboardimplementation for grid copy and paste.finally.Confidence Score: 4/5
The retained Shift+Arrow sequence should be fixed before merging because it leaves the bulk-import test vulnerable to the same intermittent failure this PR addresses.
One range-selection step still dispatches keyboard events that both react-data-grid and the application process, so its selected range and subsequent clipboard assertions remain nondeterministic.
Files Needing Attention: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/BulkImport.spec.ts
Important Files Changed
Reviews (1): Last reviewed commit: "Fixed bulk import spec" | Re-trigger Greptile