From bdf95186f0ef7d8882309f41ad2b1f1de35b05e6 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 18 Apr 2024 10:49:09 -0700 Subject: [PATCH] test: add test for tab blurring in firefox (#30418) References https://github.com/microsoft/playwright/issues/30399 --- tests/library/emulation-focus.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/library/emulation-focus.spec.ts b/tests/library/emulation-focus.spec.ts index 94f18927b4..3bf81b4968 100644 --- a/tests/library/emulation-focus.spec.ts +++ b/tests/library/emulation-focus.spec.ts @@ -187,6 +187,19 @@ browserTest('should focus with more than one page/context', async ({ contextFact expect(await page2.evaluate(() => !!window['gotFocus'])).toBe(true); }); +browserTest('should not fire blur events when interacting with more than one page/context', async ({ contextFactory, browserName }) => { + it.fixme(browserName === 'firefox', 'Firefox issues blur events for tabs'); + browserTest.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30399' }); + const page1 = await (await contextFactory()).newPage(); + const page2 = await (await contextFactory()).newPage(); + await page1.setContent(``); + await page2.setContent(``); + await page1.click('#foo'); + await page2.click('#foo'); + expect(await page1.evaluate(() => !!window['gotBlur'])).toBe(false); + expect(await page2.evaluate(() => !!window['gotBlur'])).toBe(false); +}); + browserTest('should trigger hover state concurrently', async ({ browserType, browserName }) => { browserTest.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/27969' }); browserTest.fixme(browserName === 'firefox');