From 995300b77878ad3503c5bd80891cfcad970557c1 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 11 Dec 2019 22:43:06 -0800 Subject: [PATCH] test: rearrange / uncomment some tests --- test/features/interception.spec.js | 18 ++++++++++++++++++ test/frame.spec.js | 4 ++-- test/input.spec.js | 2 +- test/mouse.spec.js | 2 +- test/network.spec.js | 15 --------------- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/test/features/interception.spec.js b/test/features/interception.spec.js index 4a3e905be7..c80b9f45be 100644 --- a/test/features/interception.spec.js +++ b/test/features/interception.spec.js @@ -627,6 +627,24 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { expect(await page.evaluate(() => window.navigator.onLine)).toBe(true); }); }); + + describe('Interception vs isNavigationRequest', () => { + it('should work with request interception', async({page, server}) => { + const requests = new Map(); + page.on('request', request => { + requests.set(request.url().split('/').pop(), request); + page.interception.continue(request); + }); + await page.interception.enable(); + server.setRedirect('/rrredirect', '/frames/one-frame.html'); + await page.goto(server.PREFIX + '/rrredirect'); + expect(requests.get('rrredirect').isNavigationRequest()).toBe(true); + expect(requests.get('one-frame.html').isNavigationRequest()).toBe(true); + expect(requests.get('frame.html').isNavigationRequest()).toBe(true); + expect(requests.get('script.js').isNavigationRequest()).toBe(false); + expect(requests.get('style.css').isNavigationRequest()).toBe(false); + }); + }); }; /** diff --git a/test/frame.spec.js b/test/frame.spec.js index be4ca9f008..16ef962ed0 100644 --- a/test/frame.spec.js +++ b/test/frame.spec.js @@ -69,7 +69,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { }); describe('Frame Management', function() { - it.skip(WEBKIT)('should handle nested frames', async({page, server}) => { + it('should handle nested frames', async({page, server}) => { await page.goto(server.PREFIX + '/frames/nested-frames.html'); expect(utils.dumpFrames(page.mainFrame())).toEqual([ 'http://localhost:/frames/nested-frames.html', @@ -102,7 +102,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { expect(detachedFrames.length).toBe(1); expect(detachedFrames[0].isDetached()).toBe(true); }); - it.skip(WEBKIT)('should send "framenavigated" when navigating on anchor URLs', async({page, server}) => { + it('should send "framenavigated" when navigating on anchor URLs', async({page, server}) => { await page.goto(server.EMPTY_PAGE); await Promise.all([ page.goto(server.EMPTY_PAGE + '#foo'), diff --git a/test/input.spec.js b/test/input.spec.js index 896847ec37..f25d6a286f 100644 --- a/test/input.spec.js +++ b/test/input.spec.js @@ -23,7 +23,7 @@ module.exports.addTests = function({testRunner, expect, playwright, FFOX, CHROME const {describe, xdescribe, fdescribe} = testRunner; const {it, fit, xit} = testRunner; const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; - describe.skip(WEBKIT)('input', function() { + describe('input', function() { it('should upload the file', async({page, server}) => { await page.goto(server.PREFIX + '/input/fileupload.html'); const filePath = path.relative(process.cwd(), FILE_TO_UPLOAD); diff --git a/test/mouse.spec.js b/test/mouse.spec.js index 5945d19148..ff73f11353 100644 --- a/test/mouse.spec.js +++ b/test/mouse.spec.js @@ -98,7 +98,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT, MA await page.hover('#button-91'); expect(await page.evaluate(() => document.querySelector('button:hover').id)).toBe('button-91'); }); - it.skip(FFOX || WEBKIT)('should trigger hover state with removed window.Node', async({page, server}) => { + it.skip(FFOX)('should trigger hover state with removed window.Node', async({page, server}) => { await page.goto(server.PREFIX + '/input/scrollable.html'); await page.evaluate(() => delete window.Node); await page.hover('#button-6'); diff --git a/test/network.spec.js b/test/network.spec.js index f9572d4d43..a9c9389e25 100644 --- a/test/network.spec.js +++ b/test/network.spec.js @@ -309,21 +309,6 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { expect(requests.get('script.js').isNavigationRequest()).toBe(false); expect(requests.get('style.css').isNavigationRequest()).toBe(false); }); - it.skip(WEBKIT)('should work with request interception', async({page, server}) => { - const requests = new Map(); - page.on('request', request => { - requests.set(request.url().split('/').pop(), request); - page.interception.continue(request); - }); - await page.interception.enable(); - server.setRedirect('/rrredirect', '/frames/one-frame.html'); - await page.goto(server.PREFIX + '/rrredirect'); - expect(requests.get('rrredirect').isNavigationRequest()).toBe(true); - expect(requests.get('one-frame.html').isNavigationRequest()).toBe(true); - expect(requests.get('frame.html').isNavigationRequest()).toBe(true); - expect(requests.get('script.js').isNavigationRequest()).toBe(false); - expect(requests.get('style.css').isNavigationRequest()).toBe(false); - }); it('should work when navigating to image', async({page, server}) => { const requests = []; page.on('request', request => requests.push(request));