playwright
playwright copied to clipboard
[BUG] Electron firstWindow times out after upgrading to 1.28.1
Issue has been reported with 1.28.0: https://github.com/microsoft/playwright/issues/18928 but it was not fixed with https://github.com/microsoft/playwright/pull/18972 (1.28.1)
Context:
- Playwright Version: 1.28.1
- Operating System: Tested on Windows and Mac
- Node.js version: 16
- Browser: Electron
- Extra: Wasn't a problem in 1.27.1 or below. Repros 100% of the time after upgrading.
Code Snippet
import { ElectronApplication, Page, _electron as electron } from "playwright"; (async () => { const electronApp = await electron.launch({ args: [path.join(__dirname, "../dist/App.js"), '--enable-logging', '--skip-welcome', '--disable-telemetry', '--no-cached-data', ], env: { automation: "1", authConfig: JSON.stringify(config), } }); const page = await electronApp.firstWindow(); // times out after 30 seconds })();Describe the bug
After upgrading to 1.28.0 or 1.28.1, Electron tests are all timing out. Downgrading to 1.27.1 resolves the issue. Example test to assist in repro can be found here
See https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/5450 for more information. My assumption is that not all Playwright versions got updated, I cleaned up the Playwright dependencies in the project as well, so not all the browsers gets installed even tho they are not used.
@quanglam2807 could you please verify that https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/5450 fixes things?
@aslushnikov @mxschmitt Actually, the repro is copied from https://github.com/microsoft/playwright/issues/18928. I'm persoanlly not using https://github.com/AzureAD/microsoft-authentication-library-for-js
I have the same issue when using v1.28.1 with [email protected]. Downgrading to v1.27.1 fixes the problem.
Can you create a minimal repro for your scenario? This would help a ton, otherwise we cant act on it since there is no repro.
There is a template repository https://github.com/cawa-93/vite-electron-builder Update of playwright is failing on https://github.com/cawa-93/vite-electron-builder/pull/874 due to a timeout (as described by this issue)
It happens if you call electron.app.disableHardwareAcceleration() otherwise, the electron window is not created and the electronApp.firstWindow() is never resolved
Probably fixed in 1.29.1
Marking as closed then!