diff --git a/app/gui/integration-test/project-view/edgeInteractions.spec.ts b/app/gui/integration-test/project-view/edgeInteractions.spec.ts index 2aa44a81530a..5912793cebf0 100644 --- a/app/gui/integration-test/project-view/edgeInteractions.spec.ts +++ b/app/gui/integration-test/project-view/edgeInteractions.spec.ts @@ -122,7 +122,6 @@ test('Edge drop prevents further handling of event', async ({ page }) => { ) await page.mouse.click(outputPort.x, outputPort.y - 25) await expect(page.getByTestId('mouse-edited-edge')).toExist() - await page.waitForTimeout(300) // Avoid double clicks await page.mouse.click(outputPort.x, outputPort.y - 25) await expect(page.getByTestId('mouse-edited-edge')).not.toExist() await expect(locate.componentBrowser(page)).toExist() diff --git a/app/gui/integration-test/project-view/selectingNodes.spec.ts b/app/gui/integration-test/project-view/selectingNodes.spec.ts index 634720448131..852a8aae8dd2 100644 --- a/app/gui/integration-test/project-view/selectingNodes.spec.ts +++ b/app/gui/integration-test/project-view/selectingNodes.spec.ts @@ -24,7 +24,6 @@ test('Selecting nodes by click', async ({ page }) => { await expect(node2).toBeSelected() await expect(selectionMenu).toBeHidden() - await page.waitForTimeout(300) // Avoid double clicks await locate.graphNodeIcon(node1).click({ modifiers: ['Shift'] }) await expect(node1).toBeSelected() await expect(node2).toBeSelected() diff --git a/app/gui/integration-test/project-view/tableVisualisation.spec.ts b/app/gui/integration-test/project-view/tableVisualisation.spec.ts index 856e1c3b07ce..cc0a9cd8d5d2 100644 --- a/app/gui/integration-test/project-view/tableVisualisation.spec.ts +++ b/app/gui/integration-test/project-view/tableVisualisation.spec.ts @@ -28,7 +28,6 @@ test('Load Table Visualisation', async ({ page }) => { const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() await expect(tableVisualization).toContainText('10 rows.') @@ -44,7 +43,6 @@ test('Column size can be set and is retained', async ({ page }) => { const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() await expect(tableVisualization).toContainText('10 rows.') @@ -177,7 +175,6 @@ test('Single Column Of Actions Table Visualisation Test', async ({ page }) => { const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() @@ -211,7 +208,6 @@ test('Error Visualisation Test', async ({ page }) => { const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() @@ -232,7 +228,6 @@ test('get_child_node_action temmplate Test as number', async ({ page }) => { const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() @@ -272,7 +267,6 @@ test('get_child_node_action temmplate Test as text', async ({ page }) => { const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() @@ -311,7 +305,6 @@ test('GenericGrid Table Visualisation Test - single column - no links', async ({ const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() @@ -338,7 +331,6 @@ test('GenericGrid Table Visualisation Test - two column - link on second', async const aggregatedNode = graphNodeByBinding(page, 'aggregated') await aggregatedNode.click() await page.keyboard.press('Space') - await page.waitForTimeout(1000) const tableVisualization = locate.tableVisualization(page) await expect(tableVisualization).toExist() @@ -391,43 +383,34 @@ test('GenericGrid Table Visualisation Test - two column - link on second', async Then run the js prettier Remember to comment the write back out */ - test.describe('Table_Visualisation_Integration_Spec and clipboard', () => { test('Datetime test - sorting and copying', async ({ page, context }) => { await addMockClipboardInitScript(page) await loadData(page, singleColumnDatetimes) - await expectCellDataToBe( - page, - 'Value', + await expectCellDataToBe(page, 'Value', [ '2025-01-02 12:13:14.123[MET]', '2025-01-01 12:13:14.123[MET]', '2025-01-03 12:13:14.123[MET]', - ) + ]) const value = getHeaderLocator(page, { colHeaderName: 'Value' }) await value.click() // Sort ascending - await expectCellDataToBe( - page, - 'Value', + await expectCellDataToBe(page, 'Value', [ '2025-01-01 12:13:14.123[MET]', '2025-01-02 12:13:14.123[MET]', '2025-01-03 12:13:14.123[MET]', - ) + ]) await value.click() // Sort descending - await expectCellDataToBe( - page, - 'Value', + await expectCellDataToBe(page, 'Value', [ '2025-01-03 12:13:14.123[MET]', '2025-01-02 12:13:14.123[MET]', '2025-01-01 12:13:14.123[MET]', - ) + ]) await value.click() // remove sort - await expectCellDataToBe( - page, - 'Value', + await expectCellDataToBe(page, 'Value', [ '2025-01-02 12:13:14.123[MET]', '2025-01-01 12:13:14.123[MET]', '2025-01-03 12:13:14.123[MET]', - ) + ]) await expectCopyingColumnClipboardToBe( page, context, @@ -441,28 +424,44 @@ test.describe('Table_Visualisation_Integration_Spec and clipboard', () => { test('Date test - sorting and copying', async ({ page, context }) => { await addMockClipboardInitScript(page) await loadData(page, singleColumnDates) - await expectCellDataToBe(page, 'Value', '2025-01-02', '2025-01-01', '2025-01-03') + await expectCellDataToBe(page, 'Value', ['2025-01-02', '2025-01-01', '2025-01-03']) const value = getHeaderLocator(page, { colHeaderName: 'Value' }) await value.click({ position: { x: 10, y: 10 } }) // Sort ascending - await expectCellDataToBe(page, 'Value', '2025-01-01', '2025-01-02', '2025-01-03') + await expectCellDataToBe(page, 'Value', ['2025-01-01', '2025-01-02', '2025-01-03']) await value.click({ position: { x: 10, y: 10 } }) // Sort descending - await expectCellDataToBe(page, 'Value', '2025-01-03', '2025-01-02', '2025-01-01') + await expectCellDataToBe(page, 'Value', ['2025-01-03', '2025-01-02', '2025-01-01']) await value.click({ position: { x: 10, y: 10 } }) // remove sort - await expectCellDataToBe(page, 'Value', '2025-01-02', '2025-01-01', '2025-01-03') + await expectCellDataToBe(page, 'Value', ['2025-01-02', '2025-01-01', '2025-01-03']) await expectCopyingColumnClipboardToBe(page, context, 'Value', 0, 1, '2025-01-02\r\n2025-01-01') }) test('Time test - sorting and copying', async ({ page, context }) => { await addMockClipboardInitScript(page) await loadData(page, singleColumnTimes) - await expectCellDataToBe(page, 'Value', '12:14:14.123004', '12:13:14.123004', '12:15:14.123004') + await expectCellDataToBe(page, 'Value', [ + '12:14:14.123004', + '12:13:14.123004', + '12:15:14.123004', + ]) const value = getHeaderLocator(page, { colHeaderName: 'Value' }) await value.click({ position: { x: 10, y: 10 } }) // Sort ascending - await expectCellDataToBe(page, 'Value', '12:13:14.123004', '12:14:14.123004', '12:15:14.123004') + await expectCellDataToBe(page, 'Value', [ + '12:13:14.123004', + '12:14:14.123004', + '12:15:14.123004', + ]) await value.click({ position: { x: 10, y: 10 } }) // Sort descending - await expectCellDataToBe(page, 'Value', '12:15:14.123004', '12:14:14.123004', '12:13:14.123004') + await expectCellDataToBe(page, 'Value', [ + '12:15:14.123004', + '12:14:14.123004', + '12:13:14.123004', + ]) await value.click({ position: { x: 10, y: 10 } }) // remove sort - await expectCellDataToBe(page, 'Value', '12:14:14.123004', '12:13:14.123004', '12:15:14.123004') + await expectCellDataToBe(page, 'Value', [ + '12:14:14.123004', + '12:13:14.123004', + '12:15:14.123004', + ]) await expectCopyingColumnClipboardToBe( page, context, @@ -509,7 +508,7 @@ async function loadData(page: Page, data: any) { ) } -export type ColumnLocatorOptions = { +type ColumnLocatorOptions = { colId?: string colHeaderName?: string } @@ -517,7 +516,7 @@ export type ColumnLocatorOptions = { /** * Returns a locator for the header cell */ -export function getHeaderLocator(page: Page, options: ColumnLocatorOptions) { +function getHeaderLocator(page: Page, options: ColumnLocatorOptions) { if (options.colHeaderName) { return page.getByRole('columnheader', { name: options.colHeaderName }) } @@ -527,13 +526,13 @@ export function getHeaderLocator(page: Page, options: ColumnLocatorOptions) { /** * Returns a locator for the cell based off colId and rowIndex */ -export function getCellLocator(page: Page, colId: string, rowIndex: number) { +function getCellLocator(page: Page, colId: string, rowIndex: number) { const locatorString = `[row-index="${rowIndex}"] [col-id="${colId}"]` return page.locator(locatorString) } // Helper function to check cell values in a column -async function expectCellDataToBe(page: Page, colId: string, ...expectedValues: string[]) { +async function expectCellDataToBe(page: Page, colId: string, expectedValues: string[]) { for (let i = 0; i < expectedValues.length; i++) { expect(await getCellLocator(page, colId, i).textContent()).toBe(expectedValues[i]) }