diff --git a/test/assets/frames/frameset.html b/test/assets/frames/frameset.html new file mode 100644 index 00000000..4d56f888 --- /dev/null +++ b/test/assets/frames/frameset.html @@ -0,0 +1,8 @@ +
diff --git a/test/frame.spec.js b/test/frame.spec.js index 817cc037..07bd123f 100644 --- a/test/frame.spec.js +++ b/test/frame.spec.js @@ -136,6 +136,26 @@ module.exports.addTests = function({testRunner, expect}) { expect(detachedFrames.length).toBe(4); expect(navigatedFrames.length).toBe(1); }); + it('should support framesets', async({page, server}) => { + let attachedFrames = []; + let detachedFrames = []; + let navigatedFrames = []; + page.on('frameattached', frame => attachedFrames.push(frame)); + page.on('framedetached', frame => detachedFrames.push(frame)); + page.on('framenavigated', frame => navigatedFrames.push(frame)); + await page.goto(server.PREFIX + '/frames/frameset.html'); + expect(attachedFrames.length).toBe(4); + expect(detachedFrames.length).toBe(0); + expect(navigatedFrames.length).toBe(5); + + attachedFrames = []; + detachedFrames = []; + navigatedFrames = []; + await page.goto(server.EMPTY_PAGE); + expect(attachedFrames.length).toBe(0); + expect(detachedFrames.length).toBe(4); + expect(navigatedFrames.length).toBe(1); + }); it('should report frame.name()', async({page, server}) => { await utils.attachFrame(page, 'theFrameId', server.EMPTY_PAGE); await page.evaluate(url => { diff --git a/test/jshandle.spec.js b/test/jshandle.spec.js index fdd6b5bc..15b3b6df 100644 --- a/test/jshandle.spec.js +++ b/test/jshandle.spec.js @@ -43,6 +43,24 @@ module.exports.addTests = function({testRunner, expect}) { ).catch(e => error = e); expect(error.message).toContain('Are you passing a nested JSHandle?'); }); + it('should accept object handle to unserializable value', async({page, server}) => { + const aHandle = await page.evaluateHandle(() => Infinity); + expect(await page.evaluate(e => Object.is(e, Infinity), aHandle)).toBe(true); + }); + it('should use the same JS wrappers', async({page, server}) => { + const aHandle = await page.evaluateHandle(() => { + window.FOO = 123; + return window; + }); + expect(await page.evaluate(e => e.FOO, aHandle)).toBe(123); + }); + it('should work with primitives', async({page, server}) => { + const aHandle = await page.evaluateHandle(() => { + window.FOO = 123; + return window; + }); + expect(await page.evaluate(e => e.FOO, aHandle)).toBe(123); + }); }); describe('JSHandle.getProperty', function() { @@ -125,6 +143,13 @@ module.exports.addTests = function({testRunner, expect}) { expect(element).toBeTruthy(); expect(await page.evaluate(e => e.nodeType === HTMLElement.TEXT_NODE, element)); }); + it('should work with nullified Node', async({page, server}) => { + await page.setContent('