npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wdio-electron-service

v9.2.1

Published

WebdriverIO service to enable Electron testing

Readme

WDIO Electron Service

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

Makes testing Electron applications much easier via:

  • 🚗 auto-setup of required Chromedriver (for Electron v26 and above)
  • 📦 automatic path detection of your Electron application
  • 🧩 access Electron APIs within your tests
  • 🕵️ mocking of Electron APIs via a Vitest-like API
  • 🖥️ headless testing support
    • automatic Xvfb integration for Linux environments (requires WebdriverIO 9.19.1+)

Installation

You will need to install WebdriverIO, instructions can be found here.

Note: WebdriverIO 9.19.1+ is required for automatic Xvfb support via the autoXvfb configuration option. For legacy WDIO versions, you'll need to use external tools like xvfb-maybe or manually set up Xvfb for headless testing on Linux. See the Common Issues & Debugging section for more details on Xvfb setup.

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",
    },
  ],
  // ...
};

Finally, run some tests using your configuration file.

This will spin up an instance of your app in the same way that WDIO handles browsers such as Chrome or Firefox. The service works with WDIO (parallel) multiremote if you need to run additional instances simultaneously, e.g. multiple instances of your app or different combinations of your app and a Web browser.

If you use Electron Forge or Electron Builder to package your app then the service will automatically attempt to find the path to your bundled Electron application. You can provide a custom path to the binary via custom service capabilities, e.g.:

wdio.conf.ts

export const config = {
  // ...
  capabilities: [
    {
      browserName: "electron",
      "wdio:electronServiceOptions": {
        appBinaryPath: "./path/to/built/electron/app.exe",
        appArgs: ["foo", "bar=baz"],
      },
    },
  ],
  // ...
};

See the configuration doc for how to find your appBinaryPath value for the different operating systems supported by Electron.

Alternatively, you can point the service at an unpackaged app by providing the path to the main.js script. Electron will need to be installed in your node_modules. It is recommended to bundle unpackaged apps using a bundler such as Rollup, Parcel, Webpack, etc.

wdio.conf.ts

export const config = {
  // ...
  capabilities: [
    {
      browserName: "electron",
      "wdio:electronServiceOptions": {
        appEntryPoint: "./path/to/bundled/electron/main.bundle.js",
        appArgs: ["foo", "bar=baz"],
      },
    },
  ],
  // ...
};

Chromedriver Configuration

If your app uses a version of Electron which is lower than v26 then you will need to manually configure Chromedriver.

This is because WDIO uses Chrome for Testing to download Chromedriver, which only provides Chromedriver versions of v115 or newer.

Documentation

Service Configuration
Chromedriver Configuration
Accessing Electron APIs
Mocking Electron APIs
Window Management
Standalone Mode
Development
Common Issues & Debugging
Migration: v8 → v9

Development

Read the development doc if you are interested in contributing.

Example Integrations

Check out our Electron boilerplate project that showcases how to integrate WebdriverIO in an example application. You can also have a look at the Example Apps and E2Es directories in this repository.

Support

If you are having issues running WDIO with the service you should check the documented Common Issues in the first instance, then open a discussion in the main WDIO forum.

The Electron service discussion forum is much less active than the WDIO one, but if the issue you are experiencing is specific to Electron or using the service then you can open a discussion here.