From dc8d4e336e92976408a41eb5bc56087771b6138f Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Sat, 18 May 2024 19:56:37 +0530 Subject: [PATCH 1/8] test: fix mfe field disable test Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/tests/db/features/multiFieldEditor.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/playwright/tests/db/features/multiFieldEditor.spec.ts b/tests/playwright/tests/db/features/multiFieldEditor.spec.ts index 583bd875f1..8962c17b40 100644 --- a/tests/playwright/tests/db/features/multiFieldEditor.spec.ts +++ b/tests/playwright/tests/db/features/multiFieldEditor.spec.ts @@ -265,6 +265,8 @@ test.describe('Multi Field Editor', () => { // Hide field and verify grid column header await (await fields.getFieldVisibilityCheckbox({ title: defaultFieldName })).click(); + // wait for the toggle to update before clicking save + await fields.rootPage.waitForTimeout(500); await fields.saveChanges(); await verifyGridColumnHeaders({ fields: fieldsText.filter(field => field !== defaultFieldName) }); From ab2ee32ae8f895b78ccf6f3228f3ff65e51e5cd0 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 21 May 2024 16:39:01 +0530 Subject: [PATCH 2/8] test: disable fully parallel Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/playwright/playwright.config.ts b/tests/playwright/playwright.config.ts index c7acdceb90..cd797c4b5f 100644 --- a/tests/playwright/playwright.config.ts +++ b/tests/playwright/playwright.config.ts @@ -30,7 +30,7 @@ export default defineConfig({ timeout: 14000, }, /* Run tests in files in parallel */ - fullyParallel: true, + fullyParallel: false, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, From e9758c95cb030143689be17c7fe086be1e404a8f Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 21 May 2024 17:47:56 +0530 Subject: [PATCH 3/8] Update multiFieldEditor.spec.ts --- tests/playwright/tests/db/features/multiFieldEditor.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/playwright/tests/db/features/multiFieldEditor.spec.ts b/tests/playwright/tests/db/features/multiFieldEditor.spec.ts index 8962c17b40..583bd875f1 100644 --- a/tests/playwright/tests/db/features/multiFieldEditor.spec.ts +++ b/tests/playwright/tests/db/features/multiFieldEditor.spec.ts @@ -265,8 +265,6 @@ test.describe('Multi Field Editor', () => { // Hide field and verify grid column header await (await fields.getFieldVisibilityCheckbox({ title: defaultFieldName })).click(); - // wait for the toggle to update before clicking save - await fields.rootPage.waitForTimeout(500); await fields.saveChanges(); await verifyGridColumnHeaders({ fields: fieldsText.filter(field => field !== defaultFieldName) }); From 8c8df789601e9ad7bc226e32e64ddead97f801fb Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 21 May 2024 20:52:42 +0530 Subject: [PATCH 4/8] fix: wait for response in MFE Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/pages/Dashboard/Details/FieldsPage.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/playwright/pages/Dashboard/Details/FieldsPage.ts b/tests/playwright/pages/Dashboard/Details/FieldsPage.ts index 0f3946afcb..e26f765313 100644 --- a/tests/playwright/pages/Dashboard/Details/FieldsPage.ts +++ b/tests/playwright/pages/Dashboard/Details/FieldsPage.ts @@ -240,11 +240,11 @@ export class FieldsPage extends BasePage { async saveChanges() { await this.waitForResponse({ uiAction: async () => await this.saveChangesButton.click(), - requestUrlPathToMatch: 'api/v1/db/meta/views/', + requestUrlPathToMatch: 'api/v1/db/meta/tables/', httpMethodsToMatch: ['GET'], - responseJsonMatcher: json => json['list'], + responseJsonMatcher: json => json['hash'], }); - await this.rootPage.waitForTimeout(200); + await this.rootPage.waitForTimeout(1000); } getField({ title }: { title: string }) { From 6a300677e79fef055dd93c12e4713f908fcfc410 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 21 May 2024 21:09:39 +0530 Subject: [PATCH 5/8] test: mfe switch tab response validation Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../pages/Dashboard/common/Topbar/index.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/playwright/pages/Dashboard/common/Topbar/index.ts b/tests/playwright/pages/Dashboard/common/Topbar/index.ts index 6d24c4ad6d..a5f5f20f05 100644 --- a/tests/playwright/pages/Dashboard/common/Topbar/index.ts +++ b/tests/playwright/pages/Dashboard/common/Topbar/index.ts @@ -70,12 +70,22 @@ export class TopbarPage extends BasePage { } async openDetailedTab() { - await this.btn_details.click(); + await this.waitForResponse({ + uiAction: async () => await this.btn_details.click(), + requestUrlPathToMatch: 'api/v1/db/meta/tables/', + httpMethodsToMatch: ['GET'], + responseJsonMatcher: json => json['hash'], + }); await this.rootPage.waitForTimeout(500); } async openDataTab() { - await this.btn_data.click(); + await this.waitForResponse({ + uiAction: async () => await this.btn_data.click(), + requestUrlPathToMatch: 'api/v1/db/data/noco/', + httpMethodsToMatch: ['GET'], + responseJsonMatcher: json => json['list'], + }); await this.rootPage.waitForTimeout(500); } From 4ccc2686c04ebff65b066e0c8597d0bcc1338518 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 21 May 2024 21:48:16 +0530 Subject: [PATCH 6/8] test: enable fullyParallel mode Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/playwright/playwright.config.ts b/tests/playwright/playwright.config.ts index cd797c4b5f..c7acdceb90 100644 --- a/tests/playwright/playwright.config.ts +++ b/tests/playwright/playwright.config.ts @@ -30,7 +30,7 @@ export default defineConfig({ timeout: 14000, }, /* Run tests in files in parallel */ - fullyParallel: false, + fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, From 17fb0a0f3d1cb781379e26bb91a3049fc5222e23 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 22 May 2024 09:10:23 +0530 Subject: [PATCH 7/8] test: fix ERD Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/tests/db/features/erd.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/playwright/tests/db/features/erd.spec.ts b/tests/playwright/tests/db/features/erd.spec.ts index 345696bac0..00cb31eea0 100644 --- a/tests/playwright/tests/db/features/erd.spec.ts +++ b/tests/playwright/tests/db/features/erd.spec.ts @@ -225,7 +225,6 @@ test.describe('Erd', () => { await dashboard.grid.column.create({ title: 'test_column' }); // Verify - await dashboard.grid.topbar.btn_details.click(); await openErdOfATable('Country'); await erd.verifyNode({ @@ -245,7 +244,6 @@ test.describe('Erd', () => { }); // Verify - await dashboard.grid.topbar.btn_details.click(); await openErdOfATable('Country'); await erd.verifyNode({ @@ -258,7 +256,6 @@ test.describe('Erd', () => { await dashboard.grid.topbar.btn_data.click(); // Delete column await dashboard.grid.column.delete({ title: 'new_test_column' }); - await dashboard.grid.topbar.btn_details.click(); await openErdOfATable('Country'); await erd.clickShowColumnNames(); From 3ee566f5c31de9774d5b83103c706e4f03f922be Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 22 May 2024 09:32:35 +0530 Subject: [PATCH 8/8] test: webhook wfr fix Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../pages/Dashboard/WebhookForm/index.ts | 4 ++-- .../pages/Dashboard/common/Topbar/index.ts | 18 +++++++++++------- .../tests/db/features/webhook.spec.ts | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/playwright/pages/Dashboard/WebhookForm/index.ts b/tests/playwright/pages/Dashboard/WebhookForm/index.ts index 4d4a530347..a90ac19cf7 100644 --- a/tests/playwright/pages/Dashboard/WebhookForm/index.ts +++ b/tests/playwright/pages/Dashboard/WebhookForm/index.ts @@ -116,8 +116,8 @@ export class WebhookFormPage extends BasePage { await this.verifyToast({ message: 'Webhook tested successfully' }); } - async delete({ index }: { index: number }) { - await this.dashboard.grid.topbar.openDetailedTab(); + async delete({ index, wfr = true }: { index: number; wfr?: boolean }) { + await this.dashboard.grid.topbar.openDetailedTab({ waitForResponse: wfr }); await this.dashboard.details.clickWebhooksTab(); await this.dashboard.details.webhook.deleteHook({ index }); await this.rootPage.locator('div.ant-modal.active').locator('button:has-text("Delete")').click(); diff --git a/tests/playwright/pages/Dashboard/common/Topbar/index.ts b/tests/playwright/pages/Dashboard/common/Topbar/index.ts index a5f5f20f05..5597234b3c 100644 --- a/tests/playwright/pages/Dashboard/common/Topbar/index.ts +++ b/tests/playwright/pages/Dashboard/common/Topbar/index.ts @@ -69,13 +69,17 @@ export class TopbarPage extends BasePage { return await this.getClipboardText(); } - async openDetailedTab() { - await this.waitForResponse({ - uiAction: async () => await this.btn_details.click(), - requestUrlPathToMatch: 'api/v1/db/meta/tables/', - httpMethodsToMatch: ['GET'], - responseJsonMatcher: json => json['hash'], - }); + async openDetailedTab({ waitForResponse = true } = {}) { + if (waitForResponse) { + await this.waitForResponse({ + uiAction: async () => await this.btn_details.click(), + requestUrlPathToMatch: 'api/v1/db/meta/tables/', + httpMethodsToMatch: ['GET'], + responseJsonMatcher: json => json['hash'], + }); + } else { + await this.btn_details.click(); + } await this.rootPage.waitForTimeout(500); } diff --git a/tests/playwright/tests/db/features/webhook.spec.ts b/tests/playwright/tests/db/features/webhook.spec.ts index dbe54ba028..e029c1cd82 100644 --- a/tests/playwright/tests/db/features/webhook.spec.ts +++ b/tests/playwright/tests/db/features/webhook.spec.ts @@ -304,8 +304,8 @@ test.describe.serial('Webhook', () => { // - verify no trigger after delete await webhook.delete({ index: 0 }); - await webhook.delete({ index: 0 }); - await webhook.delete({ index: 0 }); + await webhook.delete({ index: 0, wfr: false }); + await webhook.delete({ index: 0, wfr: false }); await dashboard.grid.topbar.openDataTab(); await clearServerData({ request });