test: make sure frames are reported from-inside shadow DOM (#4167)

References #4163.
This commit is contained in:
Andrey Lushnikov 2019-03-15 21:01:36 -07:00 committed by GitHub
parent 854b1c0912
commit 60567575d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,6 +162,17 @@ module.exports.addTests = function({testRunner, expect}) {
expect(detachedFrames.length).toBe(4);
expect(navigatedFrames.length).toBe(1);
});
it('should report frame from-inside shadow DOM', async({page, server}) => {
await page.goto(server.PREFIX + '/shadow.html');
await page.evaluate(async url => {
const frame = document.createElement('iframe');
frame.src = url;
document.body.shadowRoot.appendChild(frame);
await new Promise(x => frame.onload = x);
}, server.EMPTY_PAGE);
expect(page.frames().length).toBe(2);
expect(page.frames()[1].url()).toBe(server.EMPTY_PAGE);
});
it('should report frame.name()', async({page, server}) => {
await utils.attachFrame(page, 'theFrameId', server.EMPTY_PAGE);
await page.evaluate(url => {