fix(firefox): fix missing awaits in mouse.click (#4561)

This applies the same fix we used on the Chrome-side and adds a test.

Fix #4536
This commit is contained in:
Andrey Lushnikov
2019-06-10 16:53:38 -07:00
committed by GitHub
parent e1432cc08a
commit 6a50888d34
2 changed files with 20 additions and 4 deletions

View File

@@ -55,6 +55,13 @@ module.exports.addTests = function({testRunner, expect, puppeteer}) {
await page.click('span');
expect(await page.evaluate(() => window.CLICKED)).toBe(42);
});
it('should not throw UnhandledPromiseRejection when page closes', async({page, server}) => {
const newPage = await page.browser().newPage();
await Promise.all([
newPage.close(),
newPage.mouse.click(1, 2),
]).catch(e => {});
});
it('should click the button after navigation ', async({page, server}) => {
await page.goto(server.PREFIX + '/input/button.html');
await page.click('button');