From 25a8023720d6b498516a33d592a9a8f1386fb9b5 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 14 Oct 2021 03:22:05 -0700 Subject: [PATCH] test: popup event for pages opened from iframe (#9484) --- tests/page/page-event-popup.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/page/page-event-popup.spec.ts b/tests/page/page-event-popup.spec.ts index 963c8c1305..adc16fd7c3 100644 --- a/tests/page/page-event-popup.spec.ts +++ b/tests/page/page-event-popup.spec.ts @@ -157,3 +157,15 @@ it('should not treat navigations as new popups', async ({ page, server }) => { await page.close(); expect(badSecondPopup).toBe(false); }); + +it('should report popup opened from iframes', async ({ page, server, browserName }) => { + it.fixme(browserName === 'firefox', 'attachedToTarget event comes without openerId'); + await page.goto(server.PREFIX + '/frames/two-frames.html'); + const frame = page.frame('uno'); + expect(frame).toBeTruthy(); + const [popup] = await Promise.all([ + page.waitForEvent('popup'), + frame.evaluate(() => window.open('')), + ]); + expect(popup).toBeTruthy(); +});