chore: restore networkidle0 alias (#1920)
This commit is contained in:
parent
95b8f61652
commit
6ecac8c164
|
|
@ -1112,6 +1112,8 @@ export class FrameTask {
|
|||
}
|
||||
|
||||
waitForLifecycle(waitUntil: types.LifecycleEvent): Promise<void> {
|
||||
if (waitUntil as unknown === 'networkidle0')
|
||||
waitUntil = 'networkidle';
|
||||
if (!types.kLifecycleEvents.has(waitUntil))
|
||||
throw new Error(`Unsupported waitUntil option ${String(waitUntil)}`);
|
||||
return this.raceAgainstFailures(new Promise((resolve, reject) => {
|
||||
|
|
|
|||
|
|
@ -172,10 +172,9 @@ describe('Page.goto', function() {
|
|||
await page.goto(server.CROSS_PROCESS_PREFIX + '/empty.html');
|
||||
await page.goto(httpsServer.EMPTY_PAGE).catch(e => void 0);
|
||||
});
|
||||
it('should throw if networkidle0 is passed as an option', async({page, server}) => {
|
||||
it('should not throw if networkidle0 is passed as an option', async({page, server}) => {
|
||||
let error = null;
|
||||
await page.goto(server.EMPTY_PAGE, {waitUntil: 'networkidle0'}).catch(err => error = err);
|
||||
expect(error.message).toContain('Unsupported waitUntil option');
|
||||
await page.goto(server.EMPTY_PAGE, {waitUntil: 'networkidle0'});
|
||||
});
|
||||
it('should throw if networkidle2 is passed as an option', async({page, server}) => {
|
||||
let error = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue