From 9fbb1cc07befe1a61ba2cab52454ef0be5dabad9 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 28 Jun 2023 12:06:06 +0800 Subject: [PATCH] fix(playwright): waitUntilContentLoads --- tests/playwright/pages/Account/License.ts | 2 +- tests/playwright/pages/Account/Users.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/playwright/pages/Account/License.ts b/tests/playwright/pages/Account/License.ts index acc5ef6ed7..43e417f733 100644 --- a/tests/playwright/pages/Account/License.ts +++ b/tests/playwright/pages/Account/License.ts @@ -11,7 +11,7 @@ export class AccountLicensePage extends BasePage { async goto() { await this.rootPage.goto(`/#/account/license`); - await this.waitUntilContentLoads(); + return this.waitUntilContentLoads(); } async waitUntilContentLoads() { diff --git a/tests/playwright/pages/Account/Users.ts b/tests/playwright/pages/Account/Users.ts index 2d59602d50..28874f8964 100644 --- a/tests/playwright/pages/Account/Users.ts +++ b/tests/playwright/pages/Account/Users.ts @@ -18,11 +18,16 @@ export class AccountUsersPage extends BasePage { } async goto() { - return this.waitForResponse({ + await this.waitForResponse({ uiAction: async () => await this.rootPage.goto('/#/account/users/list'), httpMethodsToMatch: ['GET'], requestUrlPathToMatch: `api/v1/users`, }); + return this.waitUntilContentLoads(); + } + + async waitUntilContentLoads() { + return this.rootPage.waitForResponse(resp => resp.url().includes('api/v1/users') && resp.status() === 200); } get() {