test: add test that breaks subsequent page.goto (#2775)

References #2764.
This commit is contained in:
Andrey Lushnikov 2018-06-20 13:51:47 -07:00 committed by GitHub
parent dcae6bcff4
commit 4178b989d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -472,6 +472,14 @@ module.exports.addTests = function({testRunner, expect, puppeteer, DeviceDescrip
expect(response.status()).toBe(200); expect(response.status()).toBe(200);
expect(response.securityDetails()).toBe(null); 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}) => { it('should navigate to empty page with networkidle0', async({page, server}) => {
const response = await page.goto(server.EMPTY_PAGE, {waitUntil: 'networkidle0'}); const response = await page.goto(server.EMPTY_PAGE, {waitUntil: 'networkidle0'});
expect(response.status()).toBe(200); expect(response.status()).toBe(200);