hadron-spectron
Hadron Spectron Test Support
Last updated 2 years ago by imlucas .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hadron-spectron 
SYNC missed versions from official npm registry.

hadron-spectron Linux CI Windows CI

Installation

npm install --save-dev hadron-spectron

Usage

With Mocha, create an App instance in the before hook and launch it, and quit it in the after hook. For examples and more details, see Compass' functional test README.

const { App, selector } = require('hadron-spectron');

/**
 * The path to the root of the application, as well as the electron app.
 */
const ROOT = path.join(__dirname, '..', '..', '..');

function addCustomCommands(client) {
  // Add custom commands to the client here.
}

function launchApp() {
  return new App(ROOT).launch(addCustomCommands);
}

function quitApp() {
  return app.quit();
}

describe('Functional Test', function() {
  let app = null;
  let client = null;

  before(function() {
    return launchApp().then(function(application) {
      app = application;
      client = application.client;
    });
  });

  after(function() {
    return quitApp(app);
  });
});

chai-as-promised support is provided automatically as a convenience.

License

Apache 2.0

Current Tags

  • 5.0.0                                ...           latest (2 years ago)

8 Versions

  • 5.0.0                                ...           2 years ago
  • 5.0.0-beta.3                                ...           2 years ago
  • 5.0.0-beta.2                                ...           2 years ago
  • 5.0.0-beta.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.0.1                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |