microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.11k stars 3.69k forks source link

[Bug]: Chromium - Stuck Execution on context.waitForEvent('serviceworker') with extension testing #33682

Open darshandp007 opened 2 days ago

darshandp007 commented 2 days ago

Version

1.49.0

Description

I encountered an issue while testing a Manifest v3 extension using Playwright. The execution gets stuck at the following line and does not proceed:

await context.waitForEvent('serviceworker');

Steps to reproduce:

  1. I uploaded the extension to the Chromium browser using the code provided in the Playwright documentation for Testing Chrome Extensions.
  2. The execution hangs after the above line, and no further steps are executed.

Observations:

  1. The same code worked perfectly in Playwright version 1.48.2.
  2. The issue started appearing after upgrading to the current version.

Expected behavior

The code should wait for the serviceworker event and proceed as expected.

Actual behavior

Execution is stuck indefinitely, and the serviceworker event is not detected.

Additional context

Environment

System:
  OS: Linux 6.2 Ubuntu 22.04.3
Binaries:
  Node: 18.18.2
  npm: 9.8.1
npmPackages:
  @playwright/test: 1.49.0
dgozman commented 2 days ago

@darshandp007 Could you please share a minimal reproducible that includes a sample extension and your test code? That would help to get this issue resolved. Without a repro, it's much less likely we'll be able to figure out the problem.