Electron Service
wdio-electron-service is a 3rd party package, for more information please see GitHub | npm
WebdriverIO service for testing Electron applications
Enables cross-platform E2E testing of Electron apps via the extensive WebdriverIO ecosystem.
Spiritual successor to Spectron (RIP).
Features
Using the service makes testing Electron applications much easier:
- 🚗 auto-setup of required Chromedriver
- 📦 automatic path detection of your Electron application - supports Electron Forge and Electron Builder
- 🧩 access Electron APIs within your tests
- 🕵️ mocking of Electron APIs via a Vitest-like API
Installation
You will need to install WebdriverIO
, instructions can be found here.
Quick Start
The recommended way to get up and running quickly is to use the WDIO configuration wizard.
Manual Quick Start
To get started without using the configuration wizard, you will need to install the service and @wdio/cli
:
npm install --dev @wdio/cli wdio-electron-service
Or use your package manager of choice - pnpm, yarn, etc.
Next, create your WDIO configuration file. If you need some inspiration for this, there is a working configuration in the example directory of this repository, as well as the WDIO configuration reference page.
You will need to add electron
to your services array and set an Electron capability, e.g.:
wdio.conf.ts
export const config = {
// ...
services: ['electron'],
capabilities: [
{
browserName: 'electron',
},
],
// ...
};