Browse Source

test: await filter call on hook condition operations

Signed-off-by: mertmit <mertmit99@gmail.com>
feat/export-nest
mertmit 1 year ago
parent
commit
a748869901
  1. 15
      tests/playwright/pages/Dashboard/WebhookForm/index.ts

15
tests/playwright/pages/Dashboard/WebhookForm/index.ts

@ -83,7 +83,7 @@ export class WebhookFormPage extends BasePage {
} }
if (save) { if (save) {
await this.save(); await this.save(true);
await this.close(); await this.close();
} }
} }
@ -91,18 +91,27 @@ export class WebhookFormPage extends BasePage {
async deleteCondition(p: { save: boolean }) { async deleteCondition(p: { save: boolean }) {
await this.get().locator(`.nc-filter-item-remove-btn`).click(); await this.get().locator(`.nc-filter-item-remove-btn`).click();
if (p.save) { if (p.save) {
await this.save(); await this.save(true);
await this.close(); await this.close();
} }
} }
async save() { async save(condition = false) {
const saveAction = () => this.saveButton.click(); const saveAction = () => this.saveButton.click();
await this.waitForResponse({ await this.waitForResponse({
uiAction: saveAction, uiAction: saveAction,
requestUrlPathToMatch: '/hooks', requestUrlPathToMatch: '/hooks',
httpMethodsToMatch: ['POST', 'PATCH'], httpMethodsToMatch: ['POST', 'PATCH'],
}); });
if (condition) {
await this.waitForResponse({
uiAction: saveAction,
requestUrlPathToMatch: '/filters',
httpMethodsToMatch: ['POST', 'PATCH', 'DELETE'],
});
}
await this.verifyToast({ message: 'Webhook details updated successfully' }); await this.verifyToast({ message: 'Webhook details updated successfully' });
} }

Loading…
Cancel
Save