test: add test for tab blurring in firefox

References https://github.com/microsoft/playwright/issues/30399
This commit is contained in:
Andrey Lushnikov 2024-04-18 10:10:31 -07:00
parent e2c1efad9e
commit 58bbffbab4

View file

@ -187,6 +187,19 @@ browserTest('should focus with more than one page/context', async ({ contextFact
expect(await page2.evaluate(() => !!window['gotFocus'])).toBe(true); 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(`<button id="foo" onblur="window.gotBlur=true">foo</button>`);
await page2.setContent(`<button id="foo" onblur="window.gotBlur=true">foo</button>`);
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('should trigger hover state concurrently', async ({ browserType, browserName }) => {
browserTest.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/27969' }); browserTest.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/27969' });
browserTest.fixme(browserName === 'firefox'); browserTest.fixme(browserName === 'firefox');