From 73ba7d3825375eb155b0b1ae79f3b35d8b5c71c2 Mon Sep 17 00:00:00 2001 From: Alexandra Borovova Date: Thu, 6 Jun 2024 21:12:11 +0200 Subject: [PATCH] test: ignore favicon requests in the network test for redirects (#12541) --- test/TestExpectations.json | 7 ------- test/src/network.spec.ts | 10 ++++++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/test/TestExpectations.json b/test/TestExpectations.json index 5a80d95ffcc..5d06ebe994f 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -2456,13 +2456,6 @@ "expectations": ["FAIL"], "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" }, - { - "testIdPattern": "[network.spec] network Network Events should support redirects", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["firefox", "webDriverBiDi"], - "expectations": ["FAIL"], - "comment": "Response completed for the redirect get emitter after the beforeSent (or flushed with the last responseCompleted)" - }, { "testIdPattern": "[network.spec] network Page.authenticate should allow disable authentication", "platforms": ["darwin", "linux", "win32"], diff --git a/test/src/network.spec.ts b/test/src/network.spec.ts index 32e670ac0a6..53d8632540b 100644 --- a/test/src/network.spec.ts +++ b/test/src/network.spec.ts @@ -599,16 +599,18 @@ describe('network', function () { const events: string[] = []; page.on('request', request => { - return events.push(`${request.method()} ${request.url()}`); + !isFavicon(request) && + events.push(`${request.method()} ${request.url()}`); }); page.on('response', response => { - return events.push(`${response.status()} ${response.url()}`); + !isFavicon(response) && + events.push(`${response.status()} ${response.url()}`); }); page.on('requestfinished', request => { - return events.push(`DONE ${request.url()}`); + !isFavicon(request) && events.push(`DONE ${request.url()}`); }); page.on('requestfailed', request => { - return events.push(`FAIL ${request.url()}`); + !isFavicon(request) && events.push(`FAIL ${request.url()}`); }); server.setRedirect('/foo.html', '/empty.html'); const FOO_URL = server.PREFIX + '/foo.html';