This directory contains the Electron test implementation for ektest.
To test the Electron functionality:
npm run test:electronThis will:
- Create a temporary Electron project with a simple UI
- Install Electron, Puppeteer, and ektest
- Run tests that interact with the Electron app UI
- Clean up the temporary directory after completion
The test script validates:
- ✅ Launching an Electron app using Puppeteer
- ✅ Querying DOM elements with
query(selector) - ✅ Getting
innerTextandinnerHTMLfrom elements - ✅ Clicking buttons with
.click() - ✅ Right-clicking with
.contextMenu() - ✅ Typing into input fields
- ✅ Proper cleanup after tests
The test creates:
- A basic Electron app with
main.js(main process) - An
index.htmlfile with interactive UI elements - Test file (
electron.test.js) using ektest's query API
The test requires these packages (installed automatically):
electron- For the Electron runtimepuppeteer- For browser automationwebpack&webpack-cli- For bundling tests