Open dabo248 opened 5 months ago
I was able to repro by modifying the executablePath
:
const electronApp = await _electron.launch({
executablePath: 'dist/mac-arm64/electron-playwright-issue.app/Contents/MacOS/electron-playwright-issue'
});
Can confirm this also happens in our codebase. At the beginning of our program we have this code:
const dummy = new BrowserWindow({ x: 1, y: 1, show: false });
doSomething(dummy.getNativeWindowHandle());
dummy
is the first BrowserWindow
to be created, and because we merely need a HWND
to handle WM_QUERYENDSESSION
messages, loadURL
is not called, which resulted in the same issue.
Once I added
await dummy.loadURL('about:blank');
_electron.launch
no longer hangs.
Windows 11 x64 22631
electron@28.3.3
electron-builder@24.10.0
playwright@1.45.0
Version
1.41.1
Steps to reproduce
Expected behavior
I expect the example test to succeed without setting any URL or file to the main window. Only if I load an URL (or file) with the BrowserWindow it works. See main.js for this workaround.
Actual behavior
Playwright's
electron.launch
does not return and the test runs into a timeout.I was able to track it down to _waitForAllPagesToBeInitialized not returning for the main window because of Emulation.setFocusEmulationEnabled not receiving a response.
When running the test with
DEBUG=pw:protocol npx playwright test
you can see a response for the browser view ("id":11
), but not for the browser window ("id":22
):Additional context
I first experienced this issue when switching from Electron 24.1.0 to 27.1.2 without changing the Playwright version.
Environment