Sped up: idle time removed. Click to watch the full replay with step-by-step logs.
This repo is the complete, runnable example from the TestDriver tutorial How to Test an Electron App End-to-End. The post walks through every line.
Create a blank diagram, add a rectangle from the shape panel, type a label into it, assert the labeled shape is on the canvas.
It runs on a fresh cloud machine, installs the app the way a user would, and drives it from screenshots with plain-language steps. No selectors, test IDs or changes to the app.
You need Node.js 20+ and a TestDriver API key (free to start at console.testdriver.ai).
git clone https://github.com/testdriverai/example-electron-app.git
cd example-electron-app
npm install
cp .env.example .env # then paste your key into .env
npx vitest runThe run prints a link to its replay, so you can watch what happened.
.github/workflows/testdriver.yml runs the test on every push and pull request using testdriverai/action. Set up OIDC for your team, or add your key as a repository secret named TD_API_KEY. See CI/CD.
tests/electron-app.test.mjs: the testvitest.config.js: Vitest with the TestDriver reporter.github/workflows/testdriver.yml: CI
- Tutorial: https://testdriver.ai/blog/test-electron-app
- Docs: https://docs.testdriver.ai/quickstart
- More examples: https://docs.testdriver.ai
