From 6e6649655b84c346a9fbd54f4a4894830f73aeec Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Sun, 30 Jun 2024 09:45:44 +0000 Subject: [PATCH] fix: disable network validation fix: scroll into elem before click --- .../playwright/pages/Dashboard/Grid/AggregationBar.ts | 10 +++++++--- .../tests/db/features/column-aggregation.spec.ts | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/playwright/pages/Dashboard/Grid/AggregationBar.ts b/tests/playwright/pages/Dashboard/Grid/AggregationBar.ts index 231dee6e84..c3253e624c 100644 --- a/tests/playwright/pages/Dashboard/Grid/AggregationBar.ts +++ b/tests/playwright/pages/Dashboard/Grid/AggregationBar.ts @@ -27,13 +27,17 @@ export class AggregaionBarPage extends BasePage { const overlay = this.rootPage.locator(`.nc-aggregation-${column_name}-overlay`); - const clickAggregation = (agg: string) => { - return overlay.getByTestId(`nc-aggregation-${agg}`).click(); + const clickAggregation = async (agg: string) => { + const clickElem = overlay.getByTestId(`nc-aggregation-${agg}`); + + await clickElem.scrollIntoViewIfNeeded(); + + return clickElem.click(); }; if (!skipNetworkValidation) { await this.waitForResponse({ - uiAction: () => clickAggregation(aggregation), + uiAction: async () => await clickAggregation(aggregation), httpMethodsToMatch: ['GET'], requestUrlPathToMatch: '/api/v2/tables/', }); diff --git a/tests/playwright/tests/db/features/column-aggregation.spec.ts b/tests/playwright/tests/db/features/column-aggregation.spec.ts index de16f2a790..d4f471a38b 100644 --- a/tests/playwright/tests/db/features/column-aggregation.spec.ts +++ b/tests/playwright/tests/db/features/column-aggregation.spec.ts @@ -742,6 +742,7 @@ test.describe('Field Aggregation', () => { await aggregationBar.updateAggregation({ column_name: colName, aggregation: y[0], + skipNetworkValidation: true, }); await aggregationBar.verifyAggregation({ @@ -768,6 +769,7 @@ test.describe('Field Aggregation', () => { await sharedPage.grid.aggregationBar.updateAggregation({ column_name: colName, aggregation: y[0], + skipNetworkValidation: true, }); await sharedPage.grid.aggregationBar.verifyAggregation({ @@ -988,6 +990,7 @@ test.describe('Column Aggregations - Links', () => { await aggregationBar.updateAggregation({ column_name: colName, aggregation: y[0], + skipNetworkValidation: true, }); await aggregationBar.verifyAggregation({