test: rearrange / uncomment some tests

This commit is contained in:
Pavel Feldman 2019-12-11 22:43:06 -08:00
parent 6b57f67bda
commit 995300b778
5 changed files with 22 additions and 19 deletions

View File

@ -627,6 +627,24 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
expect(await page.evaluate(() => window.navigator.onLine)).toBe(true); 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);
});
});
}; };
/** /**

View File

@ -69,7 +69,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
}); });
describe('Frame Management', function() { 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'); await page.goto(server.PREFIX + '/frames/nested-frames.html');
expect(utils.dumpFrames(page.mainFrame())).toEqual([ expect(utils.dumpFrames(page.mainFrame())).toEqual([
'http://localhost:<PORT>/frames/nested-frames.html', 'http://localhost:<PORT>/frames/nested-frames.html',
@ -102,7 +102,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
expect(detachedFrames.length).toBe(1); expect(detachedFrames.length).toBe(1);
expect(detachedFrames[0].isDetached()).toBe(true); 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 page.goto(server.EMPTY_PAGE);
await Promise.all([ await Promise.all([
page.goto(server.EMPTY_PAGE + '#foo'), page.goto(server.EMPTY_PAGE + '#foo'),

View File

@ -23,7 +23,7 @@ module.exports.addTests = function({testRunner, expect, playwright, FFOX, CHROME
const {describe, xdescribe, fdescribe} = testRunner; const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner; const {it, fit, xit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
describe.skip(WEBKIT)('input', function() { describe('input', function() {
it('should upload the file', async({page, server}) => { it('should upload the file', async({page, server}) => {
await page.goto(server.PREFIX + '/input/fileupload.html'); await page.goto(server.PREFIX + '/input/fileupload.html');
const filePath = path.relative(process.cwd(), FILE_TO_UPLOAD); const filePath = path.relative(process.cwd(), FILE_TO_UPLOAD);

View File

@ -98,7 +98,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT, MA
await page.hover('#button-91'); await page.hover('#button-91');
expect(await page.evaluate(() => document.querySelector('button:hover').id)).toBe('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.goto(server.PREFIX + '/input/scrollable.html');
await page.evaluate(() => delete window.Node); await page.evaluate(() => delete window.Node);
await page.hover('#button-6'); await page.hover('#button-6');

View File

@ -309,21 +309,6 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
expect(requests.get('script.js').isNavigationRequest()).toBe(false); expect(requests.get('script.js').isNavigationRequest()).toBe(false);
expect(requests.get('style.css').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}) => { it('should work when navigating to image', async({page, server}) => {
const requests = []; const requests = [];
page.on('request', request => requests.push(request)); page.on('request', request => requests.push(request));