Skip to content

Commit

Permalink
test: enable flaky worker tests on Firefox (#1548)
Browse files Browse the repository at this point in the history
Drive-by: remove dead websocket test.
  • Loading branch information
aslushnikov committed Mar 26, 2020
1 parent 81bd8de commit f2d72b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "751710",
"firefox_revision": "1057",
"firefox_revision": "1058",
"webkit_revision": "1182"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Expand Up @@ -85,7 +85,7 @@ const BROWSER_CONFIGS = [
...require('../lib/events').Events,
...require('../lib/chromium/events').Events,
},
missingCoverage: ['browserContext.setGeolocation', 'browserContext.setOffline', 'worker.url', 'cDPSession.send', 'cDPSession.detach'],
missingCoverage: ['browserContext.setGeolocation', 'browserContext.setOffline', 'cDPSession.send', 'cDPSession.detach'],
},
{
name: 'WebKit',
Expand Down
26 changes: 2 additions & 24 deletions test/workers.spec.js
Expand Up @@ -27,8 +27,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT,
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;

describe('Workers', function() {
// flaky: https://github.com/microsoft/playwright/pull/1297/checks?check_run_id=496348690
it.fail(FFOX && LINUX)('Page.workers', async function({page, server}) {
it('Page.workers', async function({page, server}) {
await Promise.all([
page.waitForEvent('worker'),
page.goto(server.PREFIX + '/worker/worker.html')]);
Expand Down Expand Up @@ -102,8 +101,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT,
expect(destroyed).toBe(true);
expect(page.workers().length).toBe(0);
});
// flaky: https://github.com/microsoft/playwright/pull/1277/checks?check_run_id=496461538
it.fail(FFOX && LINUX)('should report network activity', async function({page, server}) {
it('should report network activity', async function({page, server}) {
const [worker] = await Promise.all([
page.waitForEvent('worker'),
page.goto(server.PREFIX + '/worker/worker.html'),
Expand Down Expand Up @@ -133,25 +131,5 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT,
expect(response.request()).toBe(request);
expect(response.ok()).toBe(true);
});
false && it.fail(FFOX)('should report web socket activity', async function({page, server}) {
const [worker] = await Promise.all([
page.waitForEvent('worker'),
page.goto(server.PREFIX + '/worker/worker.html'),
]);
const log = [];
let socketClosed;
const socketClosePromise = new Promise(f => socketClosed = f);
page.on('websocket', ws => {
ws.on('open', () => log.push(`open<${ws.url()}>`));
ws.on('close', () => { log.push('close'); socketClosed(); });
});
worker.evaluate((port) => {
const ws = new WebSocket('ws://localhost:' + port + '/ws');
ws.addEventListener('open', () => ws.close());
}, server.PORT);

await socketClosePromise;
expect(log.join(':')).toBe(`open<ws://localhost:${server.PORT}/ws>:close`);
});
});
};

0 comments on commit f2d72b3

Please sign in to comment.