playwright: [BUG]: All webkit tests fail with `Error: browserContext.newPage: Target page, context or browser has been closed`.
System info
- Playwright Version: 1.40.0-alpha-oct-14-2023
- Operating System: WSL2 Ubuntu 20.04.6 LTS
- Browser: All
Source code
https://github.com/NashJames/Holocron.io
Not sure how relevant it would be to provide a more minimal example as the issue may be elsewhere given the existence of this ticket: #20576
Expected
All tests pass
Actual
All webkit tests fail with the identical error: Error: browserContext.newPage: Target page, context or browser has been closed.
Steps taken to resolve
pnpm i -D @playwright/test@nextpnpm exec playwright install --force --with-deps chromium firefox webkit chrome msedgeapt upgrade
Detailed Logs
These logs only represent 2 failing tests. There are 12 failing in total.
Click here
❯ DEBUG=pw:browser,pw:protocol pnpm exec playwright test --config ./config/playwright.config.ts --project=webkit ./tests/e2e/components/AppHeader.spec.ts
Running 2 tests using 2 workers
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser <launching> /root/.cache/ms-playwright/webkit-1926/pw_run.sh --inspector-pipe --headless --no-startup-window +0ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:browser <launching> /root/.cache/ms-playwright/webkit-1926/pw_run.sh --inspector-pipe --headless --no-startup-window +0ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser <launched> pid=29651 +4ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:browser <launched> pid=29652 +4ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol SEND ► {"id":1,"method":"Playwright.enable"} +0ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":1,"method":"Playwright.enable"} +0ms
pw:browser [pid=29652][err] +155ms
pw:browser [pid=29652][err] (MiniBrowser:29664): GStreamer-WARNING **: 21:26:40.839: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though. +0ms
pw:browser [pid=29652][err] +0ms
pw:browser [pid=29652][err] (MiniBrowser:29664): GStreamer-WARNING **: 21:26:40.840: Failed to load plugin '/root/.cache/ms-playwright/webkit-1926/minibrowser-wpe/sys/lib/gst/libgstfdkaac.so': libfdk-aac.so.1: cannot open shared object file: No such file or directory +0ms
pw:browser [pid=29652][err] +0ms
pw:browser [pid=29652][err] (MiniBrowser:29664): GStreamer-WARNING **: 21:26:40.840: Failed to load plugin '/root/.cache/ms-playwright/webkit-1926/minibrowser-wpe/sys/lib/gst/libgstwpe.so': libWPEWebKit-1.0.so.3: cannot open shared object file: No such file or directory +1ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser [pid=29651][err] +158ms
pw:browser [pid=29651][err] (MiniBrowser:29663): GStreamer-WARNING **: 21:26:40.840: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though. +0ms
pw:browser [pid=29651][err] +0ms
pw:browser [pid=29651][err] (MiniBrowser:29663): GStreamer-WARNING **: 21:26:40.840: Failed to load plugin '/root/.cache/ms-playwright/webkit-1926/minibrowser-wpe/sys/lib/gst/libgstfdkaac.so': libfdk-aac.so.1: cannot open shared object file: No such file or directory +0ms
pw:browser [pid=29651][err] +0ms
pw:browser [pid=29651][err] (MiniBrowser:29663): GStreamer-WARNING **: 21:26:40.841: Failed to load plugin '/root/.cache/ms-playwright/webkit-1926/minibrowser-wpe/sys/lib/gst/libgstwpe.so': libWPEWebKit-1.0.so.3: cannot open shared object file: No such file or directory +0ms
pw:protocol ◀ RECV {"result":{},"id":1} +165ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol ◀ RECV {"result":{},"id":1} +164ms
pw:protocol SEND ► {"id":2,"method":"Playwright.createContext"} +8ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol SEND ► {"id":2,"method":"Playwright.createContext"} +8ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol ◀ RECV {"result":{"browserContextId":"8000000000000002"},"id":2} +6ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"result":{"browserContextId":"8000000000000002"},"id":2} +6ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":3,"method":"Playwright.setDownloadBehavior","params":{"behavior":"allow","downloadPath":"/tmp/playwright-artifacts-kWeXwi","browserContextId":"8000000000000002"}} +3ms
pw:protocol SEND ► {"id":4,"method":"Playwright.setLanguages","params":{"browserContextId":"8000000000000002","languages":["en-US"]}} +0ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol SEND ► {"id":3,"method":"Playwright.setDownloadBehavior","params":{"behavior":"allow","downloadPath":"/tmp/playwright-artifacts-gbfRnf","browserContextId":"8000000000000002"}} +3ms
pw:protocol SEND ► {"id":4,"method":"Playwright.setLanguages","params":{"browserContextId":"8000000000000002","languages":["en-US"]}} +0ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol ◀ RECV {"result":{},"id":3} +0ms
pw:protocol ◀ RECV {"result":{},"id":4} +0ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"result":{},"id":3} +0ms
pw:protocol ◀ RECV {"result":{},"id":4} +1ms
pw:protocol SEND ► {"id":5,"method":"Playwright.createPage","params":{"browserContextId":"8000000000000002"}} +18ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":5,"method":"Playwright.createPage","params":{"browserContextId":"8000000000000002"}} +20ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"method":"Playwright.pageProxyCreated","params":{"browserContextId":"8000000000000002","pageProxyId":"8"}} +8ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol ◀ RECV {"method":"Playwright.pageProxyCreated","params":{"browserContextId":"8000000000000002","pageProxyId":"8"}} +7ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser [pid=29651][err] EGLDisplay Initialization failed: EGL_NOT_INITIALIZED +101ms
pw:browser [pid=29651][err] Could not determine the accessibility bus address +1ms
pw:protocol ◀ RECV {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"page-9","type":"page","isPaused":true}},"browserContextId":"8000000000000002","pageProxyId":"8"} +49ms
pw:protocol SEND ► {"id":6,"method":"Dialog.enable","pageProxyId":"8"} +1ms
pw:protocol SEND ► {"id":7,"method":"Emulation.setActiveAndFocused","params":{"active":true},"pageProxyId":"8"} +0ms
pw:protocol SEND ► {"id":8,"method":"Emulation.setDeviceMetricsOverride","params":{"width":1280,"height":720,"fixedLayout":false,"deviceScaleFactor":2},"pageProxyId":"8"} +1ms
pw:protocol SEND ► {"id":10,"method":"Target.sendMessageToTarget","params":{"message":"{\"id\":9,\"method\":\"Page.setScreenSizeOverride\",\"params\":{\"width\":1280,\"height\":720}}","targetId":"page-9"},"pageProxyId":"8"} +0ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:browser [pid=29652][err] EGLDisplay Initialization failed: EGL_NOT_INITIALIZED +105ms
pw:browser [pid=29652][err] Could not determine the accessibility bus address +0ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol SEND ► {"id":11,"method":"Emulation.setAuthCredentials","params":{"username":"","password":"","origin":""},"pageProxyId":"8"} +0ms
pw:protocol SEND ► {"id":13,"method":"Target.sendMessageToTarget","params":{"message":"{\"id\":12,\"method\":\"Page.enable\"}","targetId":"page-9"},"pageProxyId":"8"} +1ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol ◀ RECV {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"page-9","type":"page","isPaused":true}},"browserContextId":"8000000000000002","pageProxyId":"8"} +52ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol SEND ► {"id":15,"method":"Target.sendMessageToTarget","params":{"message":"{\"id\":14,\"method\":\"Page.getResourceTree\"}","targetId":"page-9"},"pageProxyId":"8"} +1ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":6,"method":"Dialog.enable","pageProxyId":"8"} +1ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"result":{"pageProxyId":"8"},"id":5} +0ms
pw:protocol ◀ RECV {"result":{},"id":6,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":7,"method":"Emulation.setActiveAndFocused","params":{"active":true},"pageProxyId":"8"} +0ms
pw:protocol SEND ► {"id":8,"method":"Emulation.setDeviceMetricsOverride","params":{"width":1280,"height":720,"fixedLayout":false,"deviceScaleFactor":2},"pageProxyId":"8"} +1ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"result":{},"id":7,"browserContextId":"8000000000000002","pageProxyId":"8"} +1ms
pw:protocol ◀ RECV {"result":{},"id":8,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":10,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":11,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":13,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":15,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":10,"method":"Target.sendMessageToTarget","params":{"message":"{\"id\":9,\"method\":\"Page.setScreenSizeOverride\",\"params\":{\"width\":1280,\"height\":720}}","targetId":"page-9"},"pageProxyId":"8"} +0ms
pw:protocol SEND ► {"id":11,"method":"Emulation.setAuthCredentials","params":{"username":"","password":"","origin":""},"pageProxyId":"8"} +1ms
pw:protocol SEND ► {"id":13,"method":"Target.sendMessageToTarget","params":{"message":"{\"id\":12,\"method\":\"Page.enable\"}","targetId":"page-9"},"pageProxyId":"8"} +0ms
pw:protocol SEND ► {"id":15,"method":"Target.sendMessageToTarget","params":{"message":"{\"id\":14,\"method\":\"Page.getResourceTree\"}","targetId":"page-9"},"pageProxyId":"8"} +1ms
pw:protocol ◀ RECV {"result":{"pageProxyId":"8"},"id":5} +0ms
pw:protocol ◀ RECV {"result":{},"id":6,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":7,"browserContextId":"8000000000000002","pageProxyId":"8"} +1ms
pw:protocol ◀ RECV {"result":{},"id":8,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":10,"browserContextId":"8000000000000002","pageProxyId":"8"} +1ms
pw:protocol ◀ RECV {"result":{},"id":11,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":13,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"result":{},"id":15,"browserContextId":"8000000000000002","pageProxyId":"8"} +0ms
pw:protocol ◀ RECV {"method":"Target.targetDestroyed","params":{"targetId":"page-9","crashed":true},"browserContextId":"8000000000000002","pageProxyId":"8"} +559ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"method":"Target.targetDestroyed","params":{"targetId":"page-9","crashed":true},"browserContextId":"8000000000000002","pageProxyId":"8"} +563ms
pw:protocol SEND ► {"id":16,"method":"Target.resume","params":{"targetId":"page-9"},"pageProxyId":"8"} +2ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":16,"method":"Target.resume","params":{"targetId":"page-9"},"pageProxyId":"8"} +2ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"error":{"code":-32000,"message":"Missing target for given targetId","data":[{"code":-32000,"message":"Missing target for given targetId"}]},"id":16,"browserContextId":"8000000000000002","pageProxyId":"8"} +7ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol ◀ RECV {"error":{"code":-32000,"message":"Missing target for given targetId","data":[{"code":-32000,"message":"Missing target for given targetId"}]},"id":16,"browserContextId":"8000000000000002","pageProxyId":"8"} +7ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol SEND ► {"id":17,"method":"Playwright.deleteContext","params":{"browserContextId":"8000000000000002"}} +1ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol SEND ► {"id":17,"method":"Playwright.deleteContext","params":{"browserContextId":"8000000000000002"}} +1ms
pw:browser [pid=29652][err] +576ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser [pid=29651][err] +579ms
pw:browser [pid=29651][err] (MiniBrowser:29663): GLib-GIO-CRITICAL **: 21:26:41.522: g_application_quit: assertion 'G_IS_APPLICATION (application)' failed +0ms
pw:protocol ◀ RECV {"method":"Playwright.pageProxyDestroyed","params":{"pageProxyId":"8"}} +1ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:browser [pid=29652][err] (MiniBrowser:29664): GLib-GIO-CRITICAL **: 21:26:41.522: g_application_quit: assertion 'G_IS_APPLICATION (application)' failed +0ms
pw:protocol ◀ RECV {"method":"Playwright.pageProxyDestroyed","params":{"pageProxyId":"8"}} +0ms
pw:protocol ◀ RECV {"result":{},"id":17} +1ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"result":{},"id":17} +1ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:browser [pid=29652] <gracefully close start> +6ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser [pid=29651] <gracefully close start> +6ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:protocol ◀ RECV {"result":{},"id":-9999} +5ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:protocol ◀ RECV {"result":{},"id":-9999} +4ms
pw:browser [pid=29651] <process did exit: exitCode=0, signal=null> +5ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:browser [pid=29652] <process did exit: exitCode=0, signal=null> +5ms
pw:browser [pid=29652] starting temporary directories cleanup +0ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser [pid=29651] starting temporary directories cleanup +0ms
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository
pw:browser [pid=29652] finished temporary directories cleanup +1ms
pw:browser [pid=29652] <gracefully close end> +0ms
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives
pw:browser [pid=29651] finished temporary directories cleanup +2ms
pw:browser [pid=29651] <gracefully close end> +0ms
1) [webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository ───────────────────
Error: browserContext.newPage: Target page, context or browser has been closed
2) [webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives ───────────────────────
Error: browserContext.newPage: Target page, context or browser has been closed
2 failed
[webkit] › components/AppHeader.spec.ts:14:7 › NavLinks › Data Archives ────────────────────────
[webkit] › components/AppHeader.spec.ts:23:7 › NavLinks › GitHub Repository ────────────────────
Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 23 (10 by maintainers)
I also have this issue after upgrading MacOS to Sequoia, really hard to figure out what the issue is.
For anyone else on a linux-flavoured machine having similar problems, try running the webkit browser in the command-line.
For me, when I did just that it showed a missing library:
It turns out the version of Ubuntu I’m running has that library, but a different/newer version:
Sadly for me, it was one of many missing dependencies…