node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey ยป


CLI tool to help create and add Spectron tests.


npm install spectron-cli


Initialize Spectron tests

spectron-cli init

The init command does a couple of things:

  • Creates an e2e directory, if it doesn't already exist.
  • Creates a test.spec.js file with a Spectron test template.
  • Creates a file with a template to host properties and function.

Add Spectron test file

spectron-cli add [test name]

The add command adds a new spec file with the name of your choosing (default is test.spec.js).