From 9ba2936a998199ceaa071dc814f16dffde3d8068 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Sun, 30 Jun 2024 09:45:43 +0000 Subject: [PATCH] fix: shared view aggregation tests --- .../db/features/column-aggregation.spec.ts | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/tests/playwright/tests/db/features/column-aggregation.spec.ts b/tests/playwright/tests/db/features/column-aggregation.spec.ts index 542771c614..b8f912ce16 100644 --- a/tests/playwright/tests/db/features/column-aggregation.spec.ts +++ b/tests/playwright/tests/db/features/column-aggregation.spec.ts @@ -611,6 +611,8 @@ const verificationDataAfterFilter = { test.describe('Field Aggregation', () => { let dashboard: DashboardPage, aggregationBar: AggregaionBarPage; let context: any; + let sharedLink: string; + let testContext: any; test.beforeEach(async ({ page }) => { context = await setup({ page, isEmptyProject: true }); @@ -618,7 +620,7 @@ test.describe('Field Aggregation', () => { const { api, table, base } = await columnAggregationSuite(`xcdb${context.workerId}`, context); - page.testContext = { api, table, base }; + testContext = { api, table, base }; aggregationBar = dashboard.grid.aggregationBar; @@ -670,7 +672,7 @@ test.describe('Field Aggregation', () => { } } - const { api, table, base } = page.testContext; + const { api, table, base } = testContext; await api.dbTableRow.bulkCreate('noco', base.id, table.id, [ { @@ -710,6 +712,32 @@ test.describe('Field Aggregation', () => { } }); + test('Aggregation Shared GridView Test', async ({ page }) => { + // fix me! kludge@hub; page wasn't getting loaded from previous step + sharedLink = await dashboard.grid.topbar.getSharedViewUrl(); + await page.goto(sharedLink); + + // fix me! kludge@hub; page wasn't getting loaded from previous step + await page.reload(); + const sharedPage = new DashboardPage(page, context.base); + + for (const x of Object.entries(verificationData)) { + const colName = x[0]; + + for (const y of Object.entries(x[1])) { + await sharedPage.grid.aggregationBar.updateAggregation({ + column_name: colName, + aggregation: y[0], + }); + + await sharedPage.grid.aggregationBar.verifyAggregation({ + column_name: colName, + aggregation: y[1], + }); + } + } + }); + async function columnAggregationSuite(baseTitle: string, context: NcContext, skipTableCreate?: boolean) { const api = new Api({ baseURL: `http://localhost:8080/`,