From b736b0cc2da4ed45078ceadb3d2e878f5e9e3740 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 6 Feb 2023 14:23:14 -0800 Subject: [PATCH] test: add test with wheel events and opened popup (#20620) This should be merged once Firefox Stable 1376 is rolled in. References #19685 --- tests/page/wheel.spec.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/page/wheel.spec.ts b/tests/page/wheel.spec.ts index 6abcad59ae..60c1a0bbb7 100644 --- a/tests/page/wheel.spec.ts +++ b/tests/page/wheel.spec.ts @@ -67,6 +67,31 @@ it('should dispatch wheel events @smoke', async ({ page, server }) => { }); }); +it('should dispatch wheel events after popup was opened @smoke', async ({ page, server }) => { + await page.setContent(` +
+ `); + await page.mouse.move(50, 60); + await listenForWheelEvents(page, 'div'); + await Promise.all([ + page.waitForEvent('popup'), + page.evaluate(() => window.open('')), + ]); + await page.mouse.wheel(0, 100); + await page.waitForFunction('window.scrollY === 100'); + await expectEvent(page, { + deltaX: 0, + deltaY: 100, + clientX: 50, + clientY: 60, + deltaMode: 0, + ctrlKey: false, + shiftKey: false, + altKey: false, + metaKey: false, + }); +}); + it('should dispatch wheel event on svg element', async ({ page, browserName, headless, isLinux }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/15566' }); await page.setContent(`