Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
test: unflake and enable some Firefox tests (#30461)
Dmitry Gozman4046d154ae4f
diff --git a/tests/library/emulation-focus.spec.ts b/tests/library/emulation-focus.spec.tsindex 3bf81b4968..27ad72127e 100644--- a/tests/library/emulation-focus.spec.ts+++ b/tests/library/emulation-focus.spec.ts@@ -188,7 +188,6 @@ browserTest('should focus with more than one page/context', async ({ contextFact});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();diff --git a/tests/library/hit-target.spec.ts b/tests/library/hit-target.spec.tsindex 4b97ffd6dd..1476018900 100644--- a/tests/library/hit-target.spec.ts+++ b/tests/library/hit-target.spec.ts@@ -265,7 +265,7 @@ it('should not click an element overlaying iframe with the target', async ({ pag`);const target = page.frameLocator('iframe').frameLocator('iframe').locator('text=inner');- const error = await target.click({ timeout: 1000 }).catch(e => e);+ const error = await target.click({ timeout: 3000 }).catch(e => e);expect(await page.evaluate('window._clicked')).toBe(undefined);expect(error.message).toContain(`<div onclick="window.top._clicked=5">PINK OVERLAY</div> intercepts pointer events`);diff --git a/tests/page/elementhandle-wait-for-element-state.spec.ts b/tests/page/elementhandle-wait-for-element-state.spec.tsindex 1dc17b409b..e943d229d1 100644--- a/tests/page/elementhandle-wait-for-element-state.spec.ts+++ b/tests/page/elementhandle-wait-for-element-state.spec.ts@@ -123,6 +123,8 @@ it('should wait for stable position', async ({ page, server, browserName, platfobutton.style.transition = 'margin 10000ms linear 0s';button.style.marginLeft = '20000px';});+ // rafraf for Firefox to kick in the animation.+ await page.evaluate(() => new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f))));let done = false;const promise = button.waitForElementState('stable').then(() => done = true);await giveItAChanceToResolve(page);diff --git a/tests/page/page-click-timeout-4.spec.ts b/tests/page/page-click-timeout-4.spec.tsindex 0b167a6344..0ee7942eef 100644--- a/tests/page/page-click-timeout-4.spec.ts+++ b/tests/page/page-click-timeout-4.spec.ts@@ -24,6 +24,8 @@ it('should timeout waiting for stable position', async ({ page, server }) => {button.style.transition = 'margin 5s linear 0s';button.style.marginLeft = '200px';});+ // rafraf for Firefox to kick in the animation.+ await page.evaluate(() => new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f))));const error = await button.click({ timeout: 3000 }).catch(e => e);expect(error.message).toContain('elementHandle.click: Timeout 3000ms exceeded.');expect(error.message).toContain('waiting for element to be visible, enabled and stable');diff --git a/tests/page/page-click.spec.ts b/tests/page/page-click.spec.tsindex 9059303ba5..d4047a45b6 100644--- a/tests/page/page-click.spec.ts+++ b/tests/page/page-click.spec.ts@@ -455,6 +455,8 @@ it('should wait for stable position', async ({ page, server }) => {button.style.display = 'block';document.body.style.margin = '0';});+ // rafraf for Firefox to kick in the animation.+ await page.evaluate(() => new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f))));await page.click('button');expect(await page.evaluate(() => window['result'])).toBe('Clicked');expect(await page.evaluate('pageX')).toBe(300);