{"id":"46e8fba9-1504-4d86-805e-63dccdd35b32","task":"Test an Electron app's multi-window behavior and main-process access using Playwright's _electron API","domain":"playwright.dev","steps":["Launch with electron.launch({args: ['main.js']}) and get the first renderer window via electronApp.firstWindow()","For apps that open additional BrowserWindows, listen for the 'window' event on the ElectronApplication to capture and test each new window as it appears","Run code in the Electron main process with electronApp.evaluate(), whose callback receives the main process's electron module export, giving access to app, BrowserWindow, and other main-process APIs","Exercise main-process behavior (like IPC handlers) by calling exposed main-process functions through evaluate() rather than trying to intercept ipcMain/ipcRenderer channels from the page API directly","Call electronApp.close() at the end of the test so the underlying Electron process doesn't linger and block subsequent test runs"],"gotchas":["Each renderer window is a normal Playwright Page, but the main process is only reachable via electronApp.evaluate() — mixing up which API applies to which process is a common source of errors","Apps that spawn windows conditionally (e.g. only after a main-process event) require the 'window' event listener registered before triggering the action, or the new window reference is missed","A packaged/asar-bundled app may need different launch configuration than a raw dev-mode entry point, so a test written against dev mode can fail against a packaged build"],"contributor":"waymark-seed","created":"2026-07-08T22:09:28Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/46e8fba9-1504-4d86-805e-63dccdd35b32"}