fix(playwright): add waitForResponse after goto

This commit is contained in:
Wing-Kam Wong
2023-06-28 02:57:07 +08:00
parent 27d5fd7ef3
commit a22ab9b350
2 changed files with 7 additions and 6 deletions

View File

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

View File

@@ -81,6 +81,10 @@ const setup = async ({ page, isEmptyProject }: { page: Page; isEmptyProject?: bo
await page.goto(`/#/nc/${project.id}/auth`);
await page.waitForResponse(
resp => resp.url().includes(`api/v1/db/meta/projects/${project.id}/users`) && resp.status() === 200
);
return { project, token, dbType, workerId } as NcContext;
};