Skip to content

Commit 67d1844

Browse files
authored
fix: use default option for goto() method (networkidle -> load) (#36)
1 parent 176b204 commit 67d1844

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/packages/shared/pages/BasePage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class BasePage {
1313
async goto(url: string, options?: GotoOptions): Promise<void> {
1414
const _url = new URL(url, BASE_ORIGIN).toString()
1515
await report.step(`Go to "${url}"`, async () => {
16-
await this.page.goto(_url, { waitUntil: 'networkidle', ...options })
16+
await this.page.goto(_url, options)
1717
})
1818
}
1919

src/packages/shared/pages/LoginPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ export class LoginPage extends BasePage {
2929
await this.loginTxtFld.fill(credentials.email)
3030
await this.passwordTxtFld.fill(credentials.password)
3131
await this.signInBtn.click()
32-
await this.page.waitForLoadState('networkidle')
32+
await this.page.waitForLoadState()
3333
}
3434
}

src/services/storage-state/ss.helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function saveSsFileByLocalViaBrowser(credentials: Credentials): Pro
3030
await page.goto(`${BASE_ORIGIN}/login`)
3131
const loginPage = new LoginPage(page)
3232
await loginPage.signIn(credentials)
33-
await page.waitForLoadState('networkidle')
33+
await page.waitForLoadState()
3434
await page.context().storageState({ path: `${SS_PATH_PREFIX}${BASE_URL.hostname}-${credentials.email}.json` })
3535
await browser.close()
3636

@@ -46,7 +46,7 @@ export async function saveSsFileBySsoViaBrowser(credentials: Credentials): Promi
4646
headless: !!process.env.CI,
4747
})
4848
const page = await newPage(browser, credentials)
49-
await page.goto(BASE_ORIGIN, { waitUntil: 'networkidle', timeout: PAGE_LOADING })
49+
await page.goto(BASE_ORIGIN, { timeout: PAGE_LOADING })
5050
for (let i = 0; i < 10; i++) {
5151
const ss = await page.context().storageState()
5252
if (ss.cookies.length !== 0 && ss.origins.length !== 0) {

0 commit comments

Comments
 (0)