microsoft / microsoft/playwright

[Bug]: button click timeout (headless WebKit on Ubuntu 24.04.1 LTS)

Open
#33,057 22 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser-webkit P3-collecting-feedback upstream
Dominant language
TypeScript
Stars
96.3k
Forks
6.5k
Avg merge
1d 6h
Merged PRs (30d)
180

Description

### Version

1.48.0

### Steps to reproduce

1. Launch a fresh instance of Ubuntu 24.04.1 LTS (see **Additional context** for details)
2. Run [bug-playwright-button-click/init.sh](https://github.com/johnnygerard/bug-playwright-button-click/blob/main/init.sh) (uses [nodesource](https://github.com/nodesource/distributions?tab=readme-ov-file#using-ubuntu-nodejs-20) instructions for Node.js 20 installation)

### Expected behavior

All tests should pass.

### Actual behavior

Some tests fail:

```
/usr/bin/npm run e2e

> bug-playwright-button-click@1.0.0 e2e
> playwright test

Running 9 tests using 4 workers
1) [webkit] › button-user-interactions.spec.ts:12:7 › Button user interactions › Click ───────────

Test timeout of 5000ms exceeded.

Error: locator.click: Test timeout of 5000ms exceeded.
Call log:
- waiting for getByLabel(/light mode/i)
- locator resolved to …
- attempting click action
- waiting for element to be visible, enabled and stable

11 |
12 | test("Click", async ({ page }) => {
> 13 | await button.click();
| ^
14 | });
15 |
16 | test("Press enter", async ({ page }) => {

at ~/bug-playwright-button-click/tests/button-user-interactions.spec.ts:13:18

2) [webkit] › button-user-interactions.spec.ts:20:7 › Button user interactions › Tap ─────────────

Test timeout of 5000ms exceeded.

Error: locator.tap: Test timeout of 5000ms exceeded.
Call log:
- waiting for getByLabel(/light mode/i)
- locator resolved to …
- attempting tap action
- waiting for element to be visible, enabled and stable

19 |
20 | test("Tap", async ({ page }) => {
> 21 | await button.tap();
| ^
22 | });
23 | });
24 |

at ~/bug-playwright-button-click/tests/button-user-interactions.spec.ts:21:18

2 failed
[webkit] › button-user-interactions.spec.ts:12:7 › Button user interactions › Click ────────────
[webkit] › button-user-interactions.spec.ts:20:7 › Button user interactions › Tap ──────────────
7 passed (9.9s)

Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.

```

### Additional context

The tests only fail in specific conditions: only WebKit in `--headless` or `--ui` mode in Ubuntu 24.04.1 LTS (on my current machine and also on a fresh install).

I tried various combinations:

- Tests pass on Ubuntu 22 LTS but fail on Ubuntu 24 LTS.
- CI tests pass with GitHub Actions (ubuntu-latest still uses Ubuntu 22 LTS).
- Tests always pass when run in `--headed` mode regardless of Ubuntu version.
- Tests pass when running on [WSL](https://ubuntu.com/desktop/wsl) and [multipass](https://multipass.run/) with Ubuntu 24.04.1 LTS (maybe because of the lack of a desktop environment or differences in the installed packages).

A simple workaround is to use `button.press("Enter")` instead of `button.click()` and `button.tap()`.

### Environment

System:
OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
CPU: (8) x64 Intel(R) Core(TM) i3-10100 CPU @ 3.60GHz
Memory: 10.36 GB / 15.24 GB
Container: Yes
Binaries:
Node: 20.18.0 - /usr/bin/node
npm: 10.9.0 - /usr/bin/npm
pnpm: 9.12.1 - /usr/bin/pnpm
Languages:
Bash: 5.2.21 - /usr/bin/bash
npmPackages:
@playwright/test: ^1.48.0 => 1.48.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reproduction from bug-playwright-button-click/init.sh on Ubuntu 24.04.1 LTS, focusing on WebKit headless or UI mode. Read tests/button-user-interactions.spec.ts and compare the failing click and tap cases with the passing Enter case. Done means the affected click and tap tests pass under the reported conditions without relying on the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, typescript
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.