diff --git a/packages/testing/playwright/.janitor-baseline.json b/packages/testing/playwright/.janitor-baseline.json index 6ea65ba611f..48bfba75d0b 100644 --- a/packages/testing/playwright/.janitor-baseline.json +++ b/packages/testing/playwright/.janitor-baseline.json @@ -1,7 +1,7 @@ { "version": 1, - "generated": "2026-06-18T19:05:16.597Z", - "totalViolations": 404, + "generated": "2026-06-18T23:03:08.824Z", + "totalViolations": 361, "violations": { "pages/AIAssistantPage.ts": [ { @@ -86,24 +86,12 @@ "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", "hash": "4087a9cf20cb" }, - { - "rule": "scope-lockdown", - "line": 46, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, { "rule": "scope-lockdown", "line": 118, "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", "hash": "4087a9cf20cb" }, - { - "rule": "scope-lockdown", - "line": 278, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, { "rule": "scope-lockdown", "line": 327, @@ -152,18 +140,6 @@ "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", "hash": "4087a9cf20cb" }, - { - "rule": "scope-lockdown", - "line": 377, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, - { - "rule": "scope-lockdown", - "line": 403, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, { "rule": "scope-lockdown", "line": 439, @@ -224,30 +200,12 @@ "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", "hash": "4087a9cf20cb" }, - { - "rule": "scope-lockdown", - "line": 521, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, { "rule": "scope-lockdown", "line": 583, "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", "hash": "4087a9cf20cb" }, - { - "rule": "scope-lockdown", - "line": 628, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, - { - "rule": "scope-lockdown", - "line": 634, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, { "rule": "scope-lockdown", "line": 658, @@ -272,12 +230,6 @@ "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", "hash": "4087a9cf20cb" }, - { - "rule": "scope-lockdown", - "line": 814, - "message": "NodeDetailsViewPage: Unscoped locator - use this.container instead of this.page", - "hash": "4087a9cf20cb" - }, { "rule": "scope-lockdown", "line": 868, @@ -414,12 +366,6 @@ "message": "WorkflowSettingsModal: Unscoped locator - use this.container instead of this.page", "hash": "d38a3afc984b" }, - { - "rule": "scope-lockdown", - "line": 120, - "message": "WorkflowSettingsModal: Unscoped locator - use this.container instead of this.page", - "hash": "d38a3afc984b" - }, { "rule": "scope-lockdown", "line": 124, @@ -444,12 +390,6 @@ "message": "WorkflowSettingsModal: Unscoped locator - use this.container instead of this.page", "hash": "d38a3afc984b" }, - { - "rule": "scope-lockdown", - "line": 164, - "message": "WorkflowSettingsModal: Unscoped locator - use this.container instead of this.page", - "hash": "d38a3afc984b" - }, { "rule": "scope-lockdown", "line": 180, @@ -1196,12 +1136,6 @@ } ], "tests/e2e/regression/AI-1401-sub-nodes-input-panel.spec.ts": [ - { - "rule": "selector-purity", - "line": 24, - "message": "Chained locator call in test: n8n.ndv.inputPanel.get().locator('[data-test-id*=\"input-s...", - "hash": "5b81996ceda2" - }, { "rule": "selector-purity", "line": 27, @@ -1616,18 +1550,6 @@ } ], "tests/e2e/workflows/editor/expressions/mapping.spec.ts": [ - { - "rule": "selector-purity", - "line": 61, - "message": "Chained locator call in test: n8n.ndv.inputPanel.get().getByText(expectedJsonText)", - "hash": "1e0a3badc77d" - }, - { - "rule": "selector-purity", - "line": 107, - "message": "Chained locator call in test: n8n.ndv.inputPanel.get().getByText('Schedule Trigger')", - "hash": "4d388eb16f57" - }, { "rule": "selector-purity", "line": 118, @@ -1647,116 +1569,6 @@ "hash": "e286b40da00e" } ], - "tests/e2e/workflows/editor/ndv/io-filter.spec.ts": [ - { - "rule": "selector-purity", - "line": 33, - "message": "Chained locator call in test: pagination.locator('li')", - "hash": "168882c0ae00" - }, - { - "rule": "selector-purity", - "line": 34, - "message": "Chained locator call in test: n8n.ndv.outputPanel.getDataContainer().locator('mark')", - "hash": "a0c20d630b71" - }, - { - "rule": "selector-purity", - "line": 43, - "message": "Chained locator call in test: n8n.ndv.outputPanel.getDataContainer().locator('mark')", - "hash": "a0c20d630b71" - }, - { - "rule": "selector-purity", - "line": 47, - "message": "Chained locator call in test: pagination.locator('li')", - "hash": "168882c0ae00" - }, - { - "rule": "selector-purity", - "line": 67, - "message": "Chained locator call in test: n8n.ndv.inputPanel.get().getByTestId('ndv-data-pagination')", - "hash": "26edba47634c" - }, - { - "rule": "selector-purity", - "line": 70, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().getByTestId('ndv-data-pagination')", - "hash": "b6bba95848f9" - }, - { - "rule": "selector-purity", - "line": 74, - "message": "Chained locator call in test: getInputPagination().locator('li')", - "hash": "3eea3703c170" - }, - { - "rule": "selector-purity", - "line": 76, - "message": "Chained locator call in test: getOutputPagination().locator('li')", - "hash": "15bfaf225efa" - }, - { - "rule": "selector-purity", - "line": 83, - "message": "Chained locator call in test: getOutputPagination().locator('li')", - "hash": "15bfaf225efa" - }, - { - "rule": "selector-purity", - "line": 90, - "message": "Chained locator call in test: getOutputPagination().locator('li')", - "hash": "15bfaf225efa" - }, - { - "rule": "selector-purity", - "line": 94, - "message": "Chained locator call in test: getInputPagination().locator('li')", - "hash": "3eea3703c170" - }, - { - "rule": "selector-purity", - "line": 96, - "message": "Chained locator call in test: getOutputPagination().locator('li')", - "hash": "15bfaf225efa" - }, - { - "rule": "selector-purity", - "line": 106, - "message": "Chained locator call in test: getInputPagination().locator('li')", - "hash": "3eea3703c170" - }, - { - "rule": "selector-purity", - "line": 108, - "message": "Chained locator call in test: getOutputPagination().locator('li')", - "hash": "15bfaf225efa" - }, - { - "rule": "selector-purity", - "line": 113, - "message": "Chained locator call in test: getInputPagination().locator('li')", - "hash": "3eea3703c170" - }, - { - "rule": "selector-purity", - "line": 120, - "message": "Chained locator call in test: getInputPagination().locator('li')", - "hash": "3eea3703c170" - }, - { - "rule": "selector-purity", - "line": 126, - "message": "Chained locator call in test: getInputPagination().locator('li')", - "hash": "3eea3703c170" - }, - { - "rule": "selector-purity", - "line": 128, - "message": "Chained locator call in test: getOutputPagination().locator('li')", - "hash": "15bfaf225efa" - } - ], "tests/e2e/workflows/editor/ndv/ndv-core.spec.ts": [ { "rule": "selector-purity", @@ -1778,47 +1590,17 @@ "message": "Chained locator call in test: objectValueItem.locator('.toggle')", "hash": "39445370e293" }, - { - "rule": "selector-purity", - "line": 83, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().getByText('5 items')", - "hash": "b39f560b0a08" - }, - { - "rule": "selector-purity", - "line": 99, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().getByText('26 items')", - "hash": "848eee13bc7c" - }, { "rule": "selector-purity", "line": 121, "message": "Chained locator call in test: n8n.ndv.outputPanel.getTableRow(1).locator('mark')", "hash": "a1511d93e913" }, - { - "rule": "selector-purity", - "line": 136, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().locator('[class*=\"active\"]')", - "hash": "5c065b496e74" - }, { "rule": "selector-purity", "line": 148, "message": "Chained locator call in test: n8n.ndv.outputPanel.getTableRow(1).locator('mark')", "hash": "a1511d93e913" - }, - { - "rule": "selector-purity", - "line": 152, - "message": "Chained locator call in test: n8n.ndv.outputPanel.getDataContainer().locator('.json-data')", - "hash": "1c1c55e31f9e" - }, - { - "rule": "selector-purity", - "line": 255, - "message": "Chained locator call in test: n8n.ndv.outputPanel .get() .getByText('To search field va...", - "hash": "fba81950a906" } ], "tests/e2e/workflows/editor/ndv/paired-item.spec.ts": [ @@ -1848,63 +1630,21 @@ }, { "rule": "selector-purity", - "line": 108, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().locator('[data-test-id=\"hoverin...", - "hash": "ded8b0afba99" - }, - { - "rule": "selector-purity", - "line": 114, + "line": 112, "message": "Direct page locator call: n8n.page.getByRole('option', { name: 'Sort' }).click()", "hash": "b67bfe351564" }, { "rule": "selector-purity", - "line": 114, + "line": 112, "message": "Direct page locator call: n8n.page.getByRole('option', { name: 'Sort' })", "hash": "3a9f74bee578" }, { "rule": "selector-purity", - "line": 118, + "line": 116, "message": "Chained locator call in test: n8n.ndv.inputPanel.getTable().locator('text=1111')", "hash": "b10f5de1b09d" - }, - { - "rule": "selector-purity", - "line": 120, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().locator('[data-test-id=\"hoverin...", - "hash": "ded8b0afba99" - }, - { - "rule": "selector-purity", - "line": 198, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().getByText('False Branch (2 item...", - "hash": "e2dfa2b9e99e" - }, - { - "rule": "selector-purity", - "line": 222, - "message": "Chained locator call in test: n8n.ndv.inputPanel.get().getByText('True Branch')", - "hash": "8b44b7f292d6" - }, - { - "rule": "selector-purity", - "line": 229, - "message": "Chained locator call in test: n8n.ndv.inputPanel.get().locator('[data-test-id=\"hovering...", - "hash": "3be3c5466d44" - }, - { - "rule": "selector-purity", - "line": 238, - "message": "Chained locator call in test: n8n.ndv.inputPanel.get().getByText('False Branch')", - "hash": "45fecd9e12b5" - }, - { - "rule": "selector-purity", - "line": 250, - "message": "Chained locator call in test: n8n.ndv.outputPanel.get().locator('[data-test-id=\"hoverin...", - "hash": "ded8b0afba99" } ], "tests/e2e/workflows/editor/ndv/resource-locator.spec.ts": [ diff --git a/packages/testing/playwright/pages/NodeDetailsViewPage.ts b/packages/testing/playwright/pages/NodeDetailsViewPage.ts index ba04a2b0b80..8623bf09bac 100644 --- a/packages/testing/playwright/pages/NodeDetailsViewPage.ts +++ b/packages/testing/playwright/pages/NodeDetailsViewPage.ts @@ -151,7 +151,7 @@ export class NodeDetailsViewPage extends BasePage { const pinnedData = typeof data === 'string' ? data : JSON.stringify(data); await this.getEditPinnedDataButton().click(); - const editor = this.outputPanel.get().locator('[contenteditable="true"]'); + const editor = this.outputPanel.getContentEditableEditor(); await editor.waitFor(); await editor.click(); await editor.fill(pinnedData); @@ -528,7 +528,7 @@ export class NodeDetailsViewPage extends BasePage { } getOutputPagination() { - return this.outputPanel.get().getByTestId('ndv-data-pagination'); + return this.outputPanel.getPagination(); } getOutputPaginationPages() { diff --git a/packages/testing/playwright/pages/components/RunDataPanel.ts b/packages/testing/playwright/pages/components/RunDataPanel.ts index 0e77683f3e3..dd9708e2734 100644 --- a/packages/testing/playwright/pages/components/RunDataPanel.ts +++ b/packages/testing/playwright/pages/components/RunDataPanel.ts @@ -43,6 +43,30 @@ export class RunDataPanel { return this.root.getByTestId('ndv-data-container'); } + getPagination() { + return this.root.getByTestId('ndv-data-pagination'); + } + + getPaginationPages() { + return this.getPagination().locator('li'); + } + + getHighlightMarks() { + return this.getDataContainer().locator('mark'); + } + + getBranchTab(name: string | RegExp) { + return this.root.getByText(name); + } + + getItemsCountText(text: string | RegExp) { + return this.getItemsCount().filter({ hasText: text }); + } + + getActiveDisplayMode() { + return this.root.locator('[class*="active"]'); + } + getPinDataButton() { return this.root.getByTestId('ndv-pin-data'); } diff --git a/packages/testing/playwright/tests/e2e/regression/AI-1401-sub-nodes-input-panel.spec.ts b/packages/testing/playwright/tests/e2e/regression/AI-1401-sub-nodes-input-panel.spec.ts index 2032f096f0c..c24d2930d6d 100644 --- a/packages/testing/playwright/tests/e2e/regression/AI-1401-sub-nodes-input-panel.spec.ts +++ b/packages/testing/playwright/tests/e2e/regression/AI-1401-sub-nodes-input-panel.spec.ts @@ -21,7 +21,7 @@ test.describe( // Switch to JSON mode within the mapping view await n8n.ndv.inputPanel.switchDisplayMode('json'); // Verify the input node dropdown shows the correct parent nodes - const inputNodeSelect = n8n.ndv.inputPanel.get().locator('[data-test-id*="input-select"]'); + const inputNodeSelect = n8n.ndv.inputPanel.getNodeInputOptions(); await expect(inputNodeSelect).toBeVisible(); await inputNodeSelect.click(); await expect(n8n.page.getByRole('option', { name: 'Edit Fields' })).toBeVisible(); diff --git a/packages/testing/playwright/tests/e2e/workflows/editor/expressions/mapping.spec.ts b/packages/testing/playwright/tests/e2e/workflows/editor/expressions/mapping.spec.ts index 49c40dfabf1..a92aa5b2215 100644 --- a/packages/testing/playwright/tests/e2e/workflows/editor/expressions/mapping.spec.ts +++ b/packages/testing/playwright/tests/e2e/workflows/editor/expressions/mapping.spec.ts @@ -58,7 +58,7 @@ test.describe( const expectedJsonText = '[ { "input": [ { "count": 0, "with space": "!!", "with.dot": "!!", "with"quotes": "!!" } ] }, { "input": [ { "count": 1 } ] }]'; await expect(async () => { - await expect(n8n.ndv.inputPanel.get().getByText(expectedJsonText)).toBeVisible(); + await expect(n8n.ndv.inputPanel.getJsonDataContainer()).toContainText(expectedJsonText); }).toPass({ timeout: 1000 }); await expect(n8n.ndv.inputPanel.getJsonDataContainer()).toBeVisible(); @@ -104,7 +104,7 @@ test.describe( await n8n.canvas.openNode('Set1'); await n8n.ndv.executePrevious(); - const scheduleNode = n8n.ndv.inputPanel.get().getByText('Schedule Trigger'); + const scheduleNode = n8n.ndv.inputPanel.getBranchTab('Schedule Trigger'); await expect(scheduleNode).toBeVisible(); await scheduleNode.click(); diff --git a/packages/testing/playwright/tests/e2e/workflows/editor/ndv/io-filter.spec.ts b/packages/testing/playwright/tests/e2e/workflows/editor/ndv/io-filter.spec.ts index 625adf61221..ff7236d9e5e 100644 --- a/packages/testing/playwright/tests/e2e/workflows/editor/ndv/io-filter.spec.ts +++ b/packages/testing/playwright/tests/e2e/workflows/editor/ndv/io-filter.spec.ts @@ -29,9 +29,9 @@ test.describe( await expect(searchInput).toBeFocused(); // 35 items with page size 25 = 2 pages - const pagination = n8n.ndv.getOutputPagination(); - await expect(pagination.locator('li')).toHaveCount(2); - await expect(n8n.ndv.outputPanel.getDataContainer().locator('mark')).toHaveCount(0); + const pagination = n8n.ndv.outputPanel.getPagination(); + await expect(n8n.ndv.outputPanel.getPaginationPages()).toHaveCount(2); + await expect(n8n.ndv.outputPanel.getHighlightMarks()).toHaveCount(0); // Search for 'zzz' - filters to 0 items, so no pagination await searchInput.fill('zzz'); @@ -40,11 +40,11 @@ test.describe( // Search for 'Reese' - filters to 1 item, no pagination, highlights visible await searchInput.fill('Reese'); await expect(pagination).toBeHidden(); - await expect(n8n.ndv.outputPanel.getDataContainer().locator('mark').first()).toBeVisible(); + await expect(n8n.ndv.outputPanel.getHighlightMarks().first()).toBeVisible(); // Clear search - back to 35 items with pagination await searchInput.clear(); - await expect(pagination.locator('li')).toHaveCount(2); + await expect(n8n.ndv.outputPanel.getPaginationPages()).toHaveCount(2); }); test('should filter input/output data separately', async ({ n8n }) => { @@ -64,69 +64,66 @@ test.describe( const inputSearchInput = n8n.ndv.inputPanel.getSearchInput(); await expect(inputSearchInput).toBeFocused(); - const getInputPagination = () => n8n.ndv.inputPanel.get().getByTestId('ndv-data-pagination'); - const getInputCounter = () => n8n.ndv.inputPanel.getItemsCount(); - const getOutputPagination = () => - n8n.ndv.outputPanel.get().getByTestId('ndv-data-pagination'); - const getOutputCounter = () => n8n.ndv.outputPanel.getItemsCount(); + const inputPanel = n8n.ndv.inputPanel; + const outputPanel = n8n.ndv.outputPanel; // 35 items with page size 25 = 2 pages - await expect(getInputPagination().locator('li')).toHaveCount(2); - await expect(getInputCounter()).toContainText('35 items'); - await expect(getOutputPagination().locator('li')).toHaveCount(2); - await expect(getOutputCounter()).toContainText('35 items'); + await expect(inputPanel.getPaginationPages()).toHaveCount(2); + await expect(inputPanel.getItemsCount()).toContainText('35 items'); + await expect(outputPanel.getPaginationPages()).toHaveCount(2); + await expect(outputPanel.getItemsCount()).toContainText('35 items'); // Search for 'Reese' - filters to 1 item (< 25, so no pagination) await inputSearchInput.fill('Reese'); - await expect(getInputPagination()).toBeHidden(); - await expect(getInputCounter()).toContainText('of 35 items'); - await expect(getOutputPagination().locator('li')).toHaveCount(2); - await expect(getOutputCounter()).toContainText('35 items'); + await expect(inputPanel.getPagination()).toBeHidden(); + await expect(inputPanel.getItemsCount()).toContainText('of 35 items'); + await expect(outputPanel.getPaginationPages()).toHaveCount(2); + await expect(outputPanel.getItemsCount()).toContainText('35 items'); // Search for 'zzz' - filters to 0 items, no pagination await inputSearchInput.fill('zzz'); - await expect(getInputPagination()).toBeHidden(); - await expect(getInputCounter()).toContainText('of 35 items'); - await expect(getOutputPagination().locator('li')).toHaveCount(2); - await expect(getOutputCounter()).toContainText('35 items'); + await expect(inputPanel.getPagination()).toBeHidden(); + await expect(inputPanel.getItemsCount()).toContainText('of 35 items'); + await expect(outputPanel.getPaginationPages()).toHaveCount(2); + await expect(outputPanel.getItemsCount()).toContainText('35 items'); await inputSearchInput.clear(); - await expect(getInputPagination().locator('li')).toHaveCount(2); - await expect(getInputCounter()).toContainText('35 items'); - await expect(getOutputPagination().locator('li')).toHaveCount(2); - await expect(getOutputCounter()).toContainText('35 items'); + await expect(inputPanel.getPaginationPages()).toHaveCount(2); + await expect(inputPanel.getItemsCount()).toContainText('35 items'); + await expect(outputPanel.getPaginationPages()).toHaveCount(2); + await expect(outputPanel.getItemsCount()).toContainText('35 items'); - await n8n.ndv.outputPanel.getDataContainer().click(); + await outputPanel.getDataContainer().click(); await n8n.page.keyboard.press('/'); - await expect(n8n.ndv.inputPanel.getSearchInput()).not.toBeFocused(); + await expect(inputPanel.getSearchInput()).not.toBeFocused(); - const outputSearchInput = n8n.ndv.outputPanel.getSearchInput(); + const outputSearchInput = outputPanel.getSearchInput(); await expect(outputSearchInput).toBeFocused(); - await expect(getInputPagination().locator('li')).toHaveCount(2); - await expect(getInputCounter()).toContainText('35 items'); - await expect(getOutputPagination().locator('li')).toHaveCount(2); - await expect(getOutputCounter()).toContainText('35 items'); + await expect(inputPanel.getPaginationPages()).toHaveCount(2); + await expect(inputPanel.getItemsCount()).toContainText('35 items'); + await expect(outputPanel.getPaginationPages()).toHaveCount(2); + await expect(outputPanel.getItemsCount()).toContainText('35 items'); // Search for 'Reese' - filters to 1 item (< 25, so no pagination) await outputSearchInput.fill('Reese'); - await expect(getInputPagination().locator('li')).toHaveCount(2); - await expect(getInputCounter()).toContainText('35 items'); - await expect(getOutputPagination()).toBeHidden(); - await expect(getOutputCounter()).toContainText('of 35 items'); + await expect(inputPanel.getPaginationPages()).toHaveCount(2); + await expect(inputPanel.getItemsCount()).toContainText('35 items'); + await expect(outputPanel.getPagination()).toBeHidden(); + await expect(outputPanel.getItemsCount()).toContainText('of 35 items'); // Search for 'zzz' - filters to 0 items, no pagination await outputSearchInput.fill('zzz'); - await expect(getInputPagination().locator('li')).toHaveCount(2); - await expect(getInputCounter()).toContainText('35 items'); - await expect(getOutputPagination()).toBeHidden(); - await expect(getOutputCounter()).toContainText('of 35 items'); + await expect(inputPanel.getPaginationPages()).toHaveCount(2); + await expect(inputPanel.getItemsCount()).toContainText('35 items'); + await expect(outputPanel.getPagination()).toBeHidden(); + await expect(outputPanel.getItemsCount()).toContainText('of 35 items'); await outputSearchInput.clear(); - await expect(getInputPagination().locator('li')).toHaveCount(2); - await expect(getInputCounter()).toContainText('35 items'); - await expect(getOutputPagination().locator('li')).toHaveCount(2); - await expect(getOutputCounter()).toContainText('35 items'); + await expect(inputPanel.getPaginationPages()).toHaveCount(2); + await expect(inputPanel.getItemsCount()).toContainText('35 items'); + await expect(outputPanel.getPaginationPages()).toHaveCount(2); + await expect(outputPanel.getItemsCount()).toContainText('35 items'); }); }, ); diff --git a/packages/testing/playwright/tests/e2e/workflows/editor/ndv/ndv-data-display.spec.ts b/packages/testing/playwright/tests/e2e/workflows/editor/ndv/ndv-data-display.spec.ts index 54e87418ca1..9a434f10cde 100644 --- a/packages/testing/playwright/tests/e2e/workflows/editor/ndv/ndv-data-display.spec.ts +++ b/packages/testing/playwright/tests/e2e/workflows/editor/ndv/ndv-data-display.spec.ts @@ -80,7 +80,7 @@ test.describe( await n8n.ndv.execute(); - await expect(n8n.ndv.outputPanel.get().getByText('5 items')).toBeVisible(); + await expect(n8n.ndv.outputPanel.getItemsCountText('5 items')).toBeVisible(); await n8n.ndv.outputPanel.switchDisplayMode('schema'); @@ -96,12 +96,12 @@ test.describe( await n8n.canvas.openNode('Set'); // 26 items with page size 25 = 2 pages, so pagination is visible - await expect(n8n.ndv.outputPanel.get().getByText('26 items')).toBeVisible(); - await expect(n8n.ndv.getOutputPagination()).toBeVisible(); + await expect(n8n.ndv.outputPanel.getItemsCountText('26 items')).toBeVisible(); + await expect(n8n.ndv.outputPanel.getPagination()).toBeVisible(); await n8n.ndv.outputPanel.switchDisplayMode('schema'); - await expect(n8n.ndv.getOutputPagination()).toBeHidden(); + await expect(n8n.ndv.outputPanel.getPagination()).toBeHidden(); }); }); @@ -133,7 +133,7 @@ test.describe( ); await n8n.canvas.openNode('Edit Fields'); - await expect(n8n.ndv.outputPanel.get().locator('[class*="active"]')).toContainText('Table'); + await expect(n8n.ndv.outputPanel.getActiveDisplayMode()).toContainText('Table'); await expect(n8n.ndv.outputPanel.getTableRow(1)).toContainText( ' ', @@ -149,7 +149,7 @@ test.describe( await n8n.ndv.outputPanel.switchDisplayMode('json'); - await expect(n8n.ndv.outputPanel.getDataContainer().locator('.json-data')).toBeVisible(); + await expect(n8n.ndv.outputPanel.getJsonDataContainer()).toBeVisible(); }); }); @@ -252,9 +252,7 @@ test.describe( await n8n.ndv.searchOutputData('foo'); await expect( - n8n.ndv.outputPanel - .get() - .getByText('To search field values, switch to table or JSON view.'), + n8n.ndv.outputPanel.getBranchTab('To search field values, switch to table or JSON view.'), ).toBeVisible(); }); }); diff --git a/packages/testing/playwright/tests/e2e/workflows/editor/ndv/paired-item.spec.ts b/packages/testing/playwright/tests/e2e/workflows/editor/ndv/paired-item.spec.ts index cde628cba23..ce3be99516a 100644 --- a/packages/testing/playwright/tests/e2e/workflows/editor/ndv/paired-item.spec.ts +++ b/packages/testing/playwright/tests/e2e/workflows/editor/ndv/paired-item.spec.ts @@ -104,9 +104,7 @@ test.describe( // Hover on input item and verify output hover state await n8n.ndv.inputPanel.getTable().locator('text=1000').hover(); - await expect( - n8n.ndv.outputPanel.get().locator('[data-test-id="hovering-item"]'), - ).toContainText('1000'); + await expect(n8n.ndv.outputPanel.getHoveringItems()).toContainText('1000'); await expect(n8n.ndv.getParameterExpressionPreviewValue()).toContainText('1000'); // Switch back to Sort input @@ -116,9 +114,7 @@ test.describe( await expect(hoveringItem).toContainText('1111'); await n8n.ndv.inputPanel.getTable().locator('text=1111').hover(); - await expect( - n8n.ndv.outputPanel.get().locator('[data-test-id="hovering-item"]'), - ).toContainText('1111'); + await expect(n8n.ndv.outputPanel.getHoveringItems()).toContainText('1111'); await expect(n8n.ndv.getParameterExpressionPreviewValue()).toContainText('1111'); }); @@ -195,7 +191,7 @@ test.describe( await n8n.ndv.outputPanel.switchDisplayMode('table'); // Switch to False Branch - await n8n.ndv.outputPanel.get().getByText('False Branch (2 items)').click(); + await n8n.ndv.outputPanel.getBranchTab('False Branch (2 items)').click(); await expect(n8n.ndv.outputPanel.getTableRow(1)).toContainText('8888'); await n8n.ndv.outputPanel.getTableRow(1).hover(); @@ -219,14 +215,14 @@ test.describe( await n8n.canvas.openNode('Set5'); // Switch to True Branch for input - await n8n.ndv.inputPanel.get().getByText('True Branch').click(); + await n8n.ndv.inputPanel.getBranchTab('True Branch').click(); await n8n.ndv.changeOutputRunSelector('(2 items)'); await expect(n8n.ndv.outputPanel.getTableRow(1)).toContainText('8888'); await n8n.ndv.outputPanel.getTableRow(1).hover(); // Should not have matching hover state when branches don't match - const hoveringItems = n8n.ndv.inputPanel.get().locator('[data-test-id="hovering-item"]'); + const hoveringItems = n8n.ndv.inputPanel.getHoveringItems(); await expect(hoveringItems).toHaveCount(0); await expect(n8n.ndv.inputPanel.getTableRow(1)).toContainText('1111'); @@ -235,7 +231,7 @@ test.describe( await expect(outputHoveringItems).toHaveCount(0); // Switch to False Branch - await n8n.ndv.inputPanel.get().getByText('False Branch').click(); + await n8n.ndv.inputPanel.getBranchTab('False Branch').click(); await expect(n8n.ndv.inputPanel.getTableRow(1)).toContainText('8888'); await n8n.ndv.inputPanel.getTableRow(1).hover(); @@ -246,9 +242,7 @@ test.describe( await n8n.ndv.changeOutputRunSelector('(2 items)'); await expect(n8n.ndv.inputPanel.getTableRow(1)).toContainText('8888'); await n8n.ndv.inputPanel.getTableRow(1).hover(); - await expect( - n8n.ndv.outputPanel.get().locator('[data-test-id="hovering-item"]'), - ).toContainText('8888'); + await expect(n8n.ndv.outputPanel.getHoveringItems()).toContainText('8888'); }); test('should auto-fix pairedItem when multiple inputs create single output', async ({