mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(test): browser.disconnect should not be awaited (#4446)
browser.disconnect does not return a promise
This commit is contained in:
parent
90a1032300
commit
bad98baf70
@ -57,7 +57,7 @@ module.exports.addTests = function({testRunner, expect, headless, puppeteer, CHR
|
||||
const browserWSEndpoint = browser.wsEndpoint();
|
||||
const remoteBrowser = await puppeteer.connect({browserWSEndpoint});
|
||||
expect(remoteBrowser.process()).toBe(null);
|
||||
await remoteBrowser.disconnect();
|
||||
remoteBrowser.disconnect();
|
||||
});
|
||||
});
|
||||
|
||||
@ -66,7 +66,7 @@ module.exports.addTests = function({testRunner, expect, headless, puppeteer, CHR
|
||||
const browserWSEndpoint = browser.wsEndpoint();
|
||||
const newBrowser = await puppeteer.connect({browserWSEndpoint});
|
||||
expect(newBrowser.isConnected()).toBe(true);
|
||||
await newBrowser.disconnect();
|
||||
newBrowser.disconnect();
|
||||
expect(newBrowser.isConnected()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
@ -149,7 +149,7 @@ module.exports.addTests = function({testRunner, expect, puppeteer}) {
|
||||
});
|
||||
const contexts = remoteBrowser.browserContexts();
|
||||
expect(contexts.length).toBe(2);
|
||||
await remoteBrowser.disconnect();
|
||||
remoteBrowser.disconnect();
|
||||
await context.close();
|
||||
});
|
||||
});
|
||||
|
@ -67,7 +67,7 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p
|
||||
const page = await remote.newPage();
|
||||
const navigationPromise = page.goto(server.PREFIX + '/one-style.html', {timeout: 60000}).catch(e => e);
|
||||
await server.waitForRequest('/one-style.css');
|
||||
await remote.disconnect();
|
||||
remote.disconnect();
|
||||
const error = await navigationPromise;
|
||||
expect(error.message).toBe('Navigation failed because browser has disconnected!');
|
||||
await browser.close();
|
||||
@ -78,7 +78,7 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p
|
||||
const remote = await puppeteer.connect({browserWSEndpoint: browser.wsEndpoint()});
|
||||
const page = await remote.newPage();
|
||||
const watchdog = page.waitForSelector('div', {timeout: 60000}).catch(e => e);
|
||||
await remote.disconnect();
|
||||
remote.disconnect();
|
||||
const error = await watchdog;
|
||||
expect(error.message).toContain('Protocol error');
|
||||
await browser.close();
|
||||
|
Loading…
Reference in New Issue
Block a user