skip to content
all examples

e2e with Electron

An Electron desktop app, launched by the runner and tested through Chromium's accessibility tree.

An Electron greeting app with three locator tests and two agent tests.

electron example app with the greeting "hello, ada!"

Run

Use Node 22.22.3+, 24.8+, or 26+. From this folder:

terminal
npm install
npm run test:e2e

The runner launches the app with the electron package installed here, on an empty user-data directory for each test. It downloads the Electron binary on the first run if needed. Each test opens a window and closes it when it ends. Run npm start to open the app yourself.

On Linux, the runner turns off Chromium's sandbox for the tests. To open the app yourself there, run npm start -- --no-sandbox. Without a display, such as in CI, run the tests under xvfb-run:

terminal
xvfb-run --auto-servernum npm run test:e2e

Agent tests

Set a Vercel AI Gateway key:

terminal
AI_GATEWAY_API_KEY="your-key" npm run test:e2e

Without the key, the agent tests skip. Add -- --no-cache to use fresh model calls. Results are in .e2e/report.json.

See e2e.config.ts and tests/ for the setup. For your own app, see the Electron guide. Electron support is experimental: read the release notes before you upgrade @e2e-dev/electron.

Last checked on 2026-11-30 with e2e and @e2e-dev/electron built from main (before the e2e 0.26.0 and @e2e-dev/electron 0.0.1 releases), Electron 45.5, and Node 24 on macOS 26. The locator tests and the agent tests passed.

[ get started ]

your verificationlayerstarts withjust one command

npx e2e init