Easily test your Electron apps using ChromeDriver and WebdriverIO. For given versions of Electron you must depend on a very specific version range of Spectron. We provide a version mapping table between Spectron version and Electron version. Spectron works with any testing framework but the example provided uses mocha. By default, mocha searches for a folder with the name test ( which we created before ). For more information on how to configure mocha, please visit mocha. Spectron exports an Application class that when configured, can start and stop your Electron application. The Electron helpers provided by Spectron require accessing the core Electron APIs in the renderer processes of your application. So, either your Electron application has nodeIntegration set to true or you'll need to expose a require window global to Spectron so it can access the core Electron APIs.

Features

  • Create an npm task in your package.json file
  • Spectron uses WebdriverIO and exposes the managed client property on the created Application instances
  • Several additional commands are provided specific to Electron
  • All the commands return a Promise
  • The electron property is your gateway to accessing the full Electron API
  • Provides you access to the main process's process global

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Spectron

Spectron Web Site

You Might Also Like
Passwordless authentication enables a secure and frictionless experience for your users | Auth0 Icon
Over two-thirds of people reuse passwords across sites, resulting in an increasingly insecure e-commerce ecosystem. Learn how passwordless can not only mitigate these issues but make the authentication experience delightful. Implement Auth0 in any application in just five minutes
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Spectron!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

JavaScript

Related Categories

JavaScript Software Development Software

Registered

2022-09-28