Skip to content

[Bug]: Pointer events don't work in Firefox in parallel #40562

@rChaoz

Description

@rChaoz

Version

1.59.1

Steps to reproduce

Run the following test. It always passes on Chromium/Safari, on Firefox it only passes when parallel = false.

import { expect, test } from "@playwright/test"

// Setting this to false makes it work on Firefox; always works on other browsers
const parallel = true

test("big", async ({ browser }) => {
    await using page1 = await (await browser.newContext()).newPage()
    await using page2 = await (await browser.newContext()).newPage()
    await using page3 = await (await browser.newContext()).newPage()
    await using page4 = await (await browser.newContext()).newPage()
    await using page5 = await (await browser.newContext()).newPage()
    const pages = [page1, page2, page3, page4, page5]
    await Promise.all(pages.map((page) => page.goto("https://zagjs.com/components/tooltip")))

    if (parallel) {
        // It doesn't work in parallel (Firefox only)
        await Promise.all(
            pages.map(async (page, index) => {
                await page.getByRole("button", { name: "Hover me" }).hover()
                await expect.soft(page.getByRole("tooltip"), `Tooltip for page${index + 1} should be visible`).toBeVisible()
            }),
        )
    } else {
        // But works in series
        for (const [index, page] of pages.entries()) {
            await page.getByRole("button", { name: "Hover me" }).hover()
            await expect.soft(page.getByRole("tooltip"), `Tooltip for page${index + 1} should be visible`).toBeVisible()
        }
    }
})

Expected behavior

When using multiple pages in Firefox, pointer events should work correctly.

Actual behavior

Pointer events are flaky, in my tests they only work in 1 out of the 5 pages (number of total pages doesn't matter, it always only works in a single page).

Additional context

This was previously reported in #27517, which was closed due to lack of bandwidth 2 years ago. The issue stated the bug only happens in headed mode, but it happens in the repro above regardless of headed/headless mode.

Environment

System:
    OS: Windows 11 10.0.26200
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
    Memory: 10.15 GB / 31.86 GB
  Binaries:
    Node: 24.4.0 - C:\Users\Matei\.vite-plus\js_runtime\node\24.4.0\node.EXE
    Yarn: 4.12.0 - C:\Users\Matei\.vite-plus\bin\yarn.EXE
    npm: 11.4.2 - C:\Users\Matei\.vite-plus\js_runtime\node\24.4.0\npm.CMD
  Languages:
    Bash: 5.1.16 - C:\Windows\System32\bash.EXE
  npmPackages:
    @playwright/test: ^1.59.1 => 1.59.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions