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 }) { 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 6d24c4ad6d..5597234b3c 100644 --- a/tests/playwright/pages/Dashboard/common/Topbar/index.ts +++ b/tests/playwright/pages/Dashboard/common/Topbar/index.ts @@ -69,13 +69,27 @@ export class TopbarPage extends BasePage { return await this.getClipboardText(); } - async openDetailedTab() { - await this.btn_details.click(); + 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); } 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); } 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(); 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 });