Browse Source

fix(playwright): waitUntilContentLoads

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
9fbb1cc07b
  1. 2
      tests/playwright/pages/Account/License.ts
  2. 7
      tests/playwright/pages/Account/Users.ts

2
tests/playwright/pages/Account/License.ts

@ -11,7 +11,7 @@ export class AccountLicensePage extends BasePage {
async goto() { async goto() {
await this.rootPage.goto(`/#/account/license`); await this.rootPage.goto(`/#/account/license`);
await this.waitUntilContentLoads(); return this.waitUntilContentLoads();
} }
async waitUntilContentLoads() { async waitUntilContentLoads() {

7
tests/playwright/pages/Account/Users.ts

@ -18,11 +18,16 @@ export class AccountUsersPage extends BasePage {
} }
async goto() { async goto() {
return this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.rootPage.goto('/#/account/users/list'), uiAction: async () => await this.rootPage.goto('/#/account/users/list'),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `api/v1/users`, requestUrlPathToMatch: `api/v1/users`,
}); });
return this.waitUntilContentLoads();
}
async waitUntilContentLoads() {
return this.rootPage.waitForResponse(resp => resp.url().includes('api/v1/users') && resp.status() === 200);
} }
get() { get() {

Loading…
Cancel
Save