From 4178b989d2997cd332cede5af53af82ab1c1a551 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 20 Jun 2018 13:51:47 -0700 Subject: [PATCH] test: add test that breaks subsequent page.goto (#2775) References #2764. --- test/page.spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/page.spec.js b/test/page.spec.js index 750a785498a..b5e20d966d6 100644 --- a/test/page.spec.js +++ b/test/page.spec.js @@ -472,6 +472,14 @@ module.exports.addTests = function({testRunner, expect, puppeteer, DeviceDescrip expect(response.status()).toBe(200); expect(response.securityDetails()).toBe(null); }); + xit('should work when page calls history API in beforeunload', async({page, server}) => { + await page.goto(server.EMPTY_PAGE); + await page.evaluate(() => { + window.addEventListener('beforeunload', () => history.replaceState(null, 'initial', window.location.href), false); + }); + const response = await page.goto(server.PREFIX + '/grid.html'); + expect(response.status()).toBe(200); + }); it('should navigate to empty page with networkidle0', async({page, server}) => { const response = await page.goto(server.EMPTY_PAGE, {waitUntil: 'networkidle0'}); expect(response.status()).toBe(200);