From a74886990102b3ede70bb23f806175fd807bca9a Mon Sep 17 00:00:00 2001 From: mertmit Date: Sun, 7 May 2023 22:27:05 +0300 Subject: [PATCH] test: await filter call on hook condition operations Signed-off-by: mertmit --- .../pages/Dashboard/WebhookForm/index.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/playwright/pages/Dashboard/WebhookForm/index.ts b/tests/playwright/pages/Dashboard/WebhookForm/index.ts index e69da5eca6..4ae388b61f 100644 --- a/tests/playwright/pages/Dashboard/WebhookForm/index.ts +++ b/tests/playwright/pages/Dashboard/WebhookForm/index.ts @@ -83,7 +83,7 @@ export class WebhookFormPage extends BasePage { } if (save) { - await this.save(); + await this.save(true); await this.close(); } } @@ -91,18 +91,27 @@ export class WebhookFormPage extends BasePage { async deleteCondition(p: { save: boolean }) { await this.get().locator(`.nc-filter-item-remove-btn`).click(); if (p.save) { - await this.save(); + await this.save(true); await this.close(); } } - async save() { + async save(condition = false) { const saveAction = () => this.saveButton.click(); await this.waitForResponse({ uiAction: saveAction, requestUrlPathToMatch: '/hooks', httpMethodsToMatch: ['POST', 'PATCH'], }); + + if (condition) { + await this.waitForResponse({ + uiAction: saveAction, + requestUrlPathToMatch: '/filters', + httpMethodsToMatch: ['POST', 'PATCH', 'DELETE'], + }); + } + await this.verifyToast({ message: 'Webhook details updated successfully' }); }