From c49320ee875fb247c447e83606453c869030eb7b Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Mon, 18 Sep 2023 18:04:02 +0200 Subject: [PATCH] =?UTF-8?q?test:=20upstream=20test=20and=20expectation=20f?= =?UTF-8?q?or=20Firefox=20sync=20to=20puppeteer=20v21=E2=80=A6=20(#10898)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/TestExpectations.json | 28 ++++++++++++++++++++-------- test/src/evaluation.spec.ts | 2 ++ test/src/page.spec.ts | 4 +++- test/src/target.spec.ts | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/test/TestExpectations.json b/test/TestExpectations.json index 13913b4e..6573b4df 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -1235,6 +1235,12 @@ "parameters": ["webDriverBiDi"], "expectations": ["PASS"] }, + { + "testIdPattern": "[proxy.spec] request proxy should respect proxy bypass list", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi", "firefox"], + "expectations": ["PASS", "FAIL"] + }, { "testIdPattern": "[queryhandler.spec] Query handler tests P selectors should work ARIA selectors", "platforms": ["darwin", "linux", "win32"], @@ -2348,20 +2354,14 @@ { "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should launch Chrome properly with --no-startup-window and waitForInitialPage=false", "platforms": ["darwin", "linux", "win32"], - "parameters": ["firefox", "webDriverBiDi"], - "expectations": ["FAIL"] - }, - { - "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should launch Chrome properly with --no-startup-window and waitForInitialPage=false", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["cdp", "firefox"], + "parameters": ["firefox"], "expectations": ["SKIP"] }, { "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should work with no default arguments", "platforms": ["darwin", "linux", "win32"], "parameters": ["firefox", "headless"], - "expectations": ["FAIL", "PASS"] + "expectations": ["SKIP"] }, { "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch tmp profile should be cleaned up", @@ -2963,6 +2963,12 @@ "parameters": ["cdp", "firefox"], "expectations": ["FAIL"] }, + { + "testIdPattern": "[network.spec] network Response.fromCache should work", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi", "firefox"], + "expectations": ["PASS", "FAIL"] + }, { "testIdPattern": "[network.spec] network Response.fromServiceWorker Response.fromServiceWorker", "platforms": ["darwin", "linux", "win32"], @@ -3875,6 +3881,12 @@ "parameters": ["cdp", "firefox"], "expectations": ["SKIP"] }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should work when resolved right before execution context disposal", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi", "firefox"], + "expectations": ["PASS", "FAIL"] + }, { "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should work with strict CSP policy", "platforms": ["darwin", "linux", "win32"], diff --git a/test/src/evaluation.spec.ts b/test/src/evaluation.spec.ts index dd120a94..811f0779 100644 --- a/test/src/evaluation.spec.ts +++ b/test/src/evaluation.spec.ts @@ -423,11 +423,13 @@ describe('Evaluation specs', function () { const {page, server} = await getTestState(); await page.goto(server.PREFIX + '/one-style.html'); + const onRequest = server.waitForRequest('/empty.html'); const result = await page.evaluate(() => { (window as any).location = '/empty.html'; return [42]; }); expect(result).toEqual([42]); + await onRequest; }); it('should transfer 100Mb of data from page to node.js', async function () { this.timeout(25_000); diff --git a/test/src/page.spec.ts b/test/src/page.spec.ts index 663038ba..4d2f092b 100644 --- a/test/src/page.spec.ts +++ b/test/src/page.spec.ts @@ -1365,7 +1365,9 @@ describe('Page', function () { const {page, server} = await getTestState(); const [error] = await Promise.all([ - waitEvent(page, 'pageerror'), + waitEvent(page, 'pageerror', err => { + return err.message.includes('Fancy'); + }), page.goto(server.PREFIX + '/error.html'), ]); expect(error.message).toContain('Fancy'); diff --git a/test/src/target.spec.ts b/test/src/target.spec.ts index 09581f2c..b5436b9e 100644 --- a/test/src/target.spec.ts +++ b/test/src/target.spec.ts @@ -336,7 +336,7 @@ describe('Target', function () { await browser .waitForTarget( target => { - return target.url() === server.EMPTY_PAGE; + return target.url() === server.PREFIX + '/does-not-exist.html'; }, { timeout: 1,