Browse Source

test: webhook wfr fix

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/8522/head
Raju Udava 6 months ago
parent
commit
3ee566f5c3
  1. 4
      tests/playwright/pages/Dashboard/WebhookForm/index.ts
  2. 18
      tests/playwright/pages/Dashboard/common/Topbar/index.ts
  3. 4
      tests/playwright/tests/db/features/webhook.spec.ts

4
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();

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

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

Loading…
Cancel
Save