From bc154d0a093c49e96c0e2147760eceee5ec807f8 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Tue, 14 Jan 2020 13:20:53 -0800 Subject: [PATCH] test: add a failing test for Page.waitForLoadState --- test/navigation.spec.js | 10 ++++++++++ test/page.spec.js | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/navigation.spec.js b/test/navigation.spec.js index 6010bacfaf..c12a0c5cd0 100644 --- a/test/navigation.spec.js +++ b/test/navigation.spec.js @@ -764,6 +764,16 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI response.end('Not found'); await navigationPromise; }); + it.skip(WEBKIT || FFOX)('should work with pages that have loaded before being connected to', async({page, context, server}) => { + await page.goto(server.EMPTY_PAGE); + await page.evaluate(async () => { + const child = window.open(document.location.href); + while(child.document.readyState !== 'complete' || child.document.location.href === 'about:blank') + await new Promise(setTimeout); + }); + const [, childPage] = await context.pages(); + await childPage.waitForLoadState(); + }); }); describe('Page.goBack', function() { diff --git a/test/page.spec.js b/test/page.spec.js index 6f4ddd18b7..f767f3cdbd 100644 --- a/test/page.spec.js +++ b/test/page.spec.js @@ -172,8 +172,7 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF expect(await page.evaluate(() => !!window.opener)).toBe(false); expect(await popup.evaluate(() => !!window.opener)).toBe(false); }); - // Crashes with Target closed on WebKit / Linux. - it('should not treat navigations as new popups', async({page, server}) => { + it.skip(WEBKIT || FFOX)('should not treat navigations as new popups', async({page, server}) => { await page.goto(server.EMPTY_PAGE); await page.setContent('yo'); const [popup] = await Promise.all([