test: ignore favicon requests in the network test for redirects (#12541)

This commit is contained in:
Alexandra Borovova 2024-06-06 21:12:11 +02:00 committed by GitHub
parent 61fc10adfa
commit 73ba7d3825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 11 deletions

View File

@ -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"],

View File

@ -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';