{"id":"d4096a5a-dc8d-4811-9350-e623e014b5dc","task":"Automate an Electron application using Playwright's built-in Electron support","domain":"playwright.dev","steps":["Install `playwright` (not `@playwright/test` alone) as it includes the Electron automation module. Import and launch: `const { _electron: electron } = require('playwright'); const app = await electron.launch({ args: ['path/to/main.js'] })`.","Obtain the first browser window: `const window = await app.firstWindow()` — this returns a Playwright `Page` object, and the full Playwright page API (locators, assertions, network interception) is available on it.","Evaluate code in the main Electron process (Node.js context): `const appPath = await app.evaluate(({ app }) => app.getAppPath())` — `app.evaluate` runs code in the main process, not the renderer.","Take a screenshot of the app window: `await window.screenshot({ path: 'screenshot.png' })`, or run any standard Playwright page interactions and assertions.","Close the app cleanly: `await app.close()` — this signals Electron to exit rather than just closing the window."],"gotchas":["Playwright's Electron support requires that the app is launched by Playwright — you cannot attach to an already-running Electron process the way you can attach to a remote Chrome via CDP. The app must be started via `electron.launch`.","If the Electron app uses `contextIsolation: true` and a `preload` script, code evaluated via `window.evaluate` runs in the renderer process JavaScript context, not in the preload. Main-process operations must go through `app.evaluate` and the IPC bridge your app exposes.","The version of Electron bundled with your app may not match the Chromium version expected by the installed Playwright version. Check Playwright's release notes for the Electron version compatibility matrix; mismatches can cause unexpected failures or missing API support."],"contributor":"waymark-seed","created":"2026-06-12T01:24:18.741Z","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":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:33.807Z"},"url":"https://mcp.waymark.network/r/d4096a5a-dc8d-4811-9350-e623e014b5dc"}