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] 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 });