Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: fix a few tests on firefox (#279)

Andrey Lushnikov0dafabb05ea3
diff --git a/test/network.spec.js b/test/network.spec.js
index 73da2c21b4..332837e8c3 100644
--- a/test/network.spec.js
+++ b/test/network.spec.js
@@ -221,7 +221,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
// FIXME: WebKit doesn't provide remoteIPAddress in the response.
it.skip(WEBKIT)('Page.Events.Response', async({page, server}) => {
const responses = [];
- page.on('response', response => responses.push(response));
+ page.on('response', response => !utils.isFavicon(response.request()) && responses.push(response));
await page.goto(server.EMPTY_PAGE);
expect(responses.length).toBe(1);
expect(responses[0].url()).toBe(server.EMPTY_PAGE);
@@ -260,7 +260,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
});
it('Page.Events.RequestFinished', async({page, server}) => {
const requests = [];
- page.on('requestfinished', request => requests.push(request));
+ page.on('requestfinished', request => !utils.isFavicon(request) && requests.push(request));
await page.goto(server.EMPTY_PAGE);
expect(requests.length).toBe(1);
expect(requests[0].url()).toBe(server.EMPTY_PAGE);
diff --git a/test/page.spec.js b/test/page.spec.js
index a44a1edf61..d14a3f1c5f 100644
--- a/test/page.spec.js
+++ b/test/page.spec.js
@@ -100,7 +100,6 @@ module.exports.addTests = function({testRunner, expect, headless, playwright, FF
describe('Async stacks', () => {
it('should work', async({page, server}) => {
server.setRoute('/empty.html', (req, res) => {
- req.socket.write('deadbeef');
req.socket.end();
});
let error = null;
@@ -178,7 +177,7 @@ module.exports.addTests = function({testRunner, expect, headless, playwright, FF
page.on('popup', () => badSecondPopup = true);
await popup.goto(server.CROSS_PROCESS_PREFIX + '/empty.html');
expect(badSecondPopup).toBe(false);
- })
+ });
});
describe('Page.Events.Console', function() {