fix(test): browser.disconnect should not be awaited (#4446)

browser.disconnect does not return a promise
This commit is contained in:
Darío Kondratiuk
2019-05-21 11:26:04 -03:00
committed by Andrey Lushnikov
parent 90a1032300
commit bad98baf70
3 changed files with 5 additions and 5 deletions

View File

@@ -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();