How to use the spectron.Application function in spectron

To help you get started, we’ve selected a few spectron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / kui / tests / lib / common.js View on Github external
opts.path = electron // this means spectron will use electron located in node_modules
    opts.args = [ appMain ] // in this mode, we need to specify the main.js to use
  }

  if (process.env.CHROMEDRIVER_PORT) {
    opts.port = process.env.CHROMEDRIVER_PORT
  }
  if (process.env.WSKNG_NODE_DEBUG) {
    // pass WSKNG_DEBUG on to NODE_DEBUG for the application
    opts.env.NODE_DEBUG = process.env.WSKNG_NODE_DEBUG
  }
  if (process.env.DEBUG) {
    opts.env.DEBUG = process.env.DEBUG
  }

  return new Application(opts)
}
github zeit / hyper / test / index.ts View on Github external
pathToBinary = path.join(__dirname, '../dist/linux-unpacked/hyper');
      break;

    case 'darwin':
      pathToBinary = path.join(__dirname, '../dist/mac/Hyper.app/Contents/MacOS/Hyper');
      break;

    case 'win32':
      pathToBinary = path.join(__dirname, '../dist/win-unpacked/Hyper.exe');
      break;

    default:
      throw new Error('Path to the built binary needs to be defined for this platform in test/index.js');
  }

  app = new Application({
    path: pathToBinary
  });

  await app.start();
});
github taku-o / myukkurivoice / test / helpWindow.js View on Github external
before(function () {
        var fsprefix = "_myubo_test" + Date.now().toString(36);
        var dirPath = temp.mkdirSync(fsprefix);
        this.app = new spectron_1.Application({
            path: 'MYukkuriVoice-darwin-x64/MYukkuriVoice.app/Contents/MacOS/MYukkuriVoice',
            env: { DEBUG: 1, NODE_ENV: 'test', userData: dirPath }
        });
        return this.app.start();
    });
    after(function () {
github railsware / upterm / test / e2e.ts View on Github external
before(async () => {
        app = new Application({path: "node_modules/.bin/electron", args: ["."]});
    });
github taku-o / myukkurivoice / test / specWindow-service-aques.js View on Github external
before(function () {
        var fsprefix = "_myubo_test" + Date.now().toString(36);
        dirPath = temp.mkdirSync(fsprefix);
        this.app = new spectron_1.Application({
            path: 'MYukkuriVoice-darwin-x64/MYukkuriVoice.app/Contents/MacOS/MYukkuriVoice',
            env: { DEBUG: 1, NODE_ENV: 'test', userData: dirPath }
        });
        return this.app.start();
    });
    after(function () {
github NebulousLabs / Sia-UI / test / main.js View on Github external
before('start electron', function() {
		app = new Application({
			path: Path.join(__dirname, '../node_modules/.bin/electron'),
			args: [Path.join(__dirname, '..')],
		});
		return app.start();
	});
github taku-o / myukkurivoice / test / specWindow-service-data.js View on Github external
before(function () {
        var fsprefix = "_myubo_test" + Date.now().toString(36);
        dirPath = temp.mkdirSync(fsprefix);
        this.app = new spectron_1.Application({
            path: 'MYukkuriVoice-darwin-x64/MYukkuriVoice.app/Contents/MacOS/MYukkuriVoice',
            env: { DEBUG: 1, NODE_ENV: 'test', userData: dirPath }
        });
        return this.app.start();
    });
    after(function () {
github dat-land / dat-desktop / tests / index.js View on Github external
function createApp (t) {
  var app = new spectron.Application({
    path: path.join(__dirname, '../node_modules/.bin/electron'),
    args: [
      path.join(__dirname, '../index.js'),
      '--data',
      TEST_DATA,
      '--db',
      TEST_DATA_DB
    ],
    env: {
      NODE_ENV: 'test',
      RUNNING_IN_SPECTRON: true,
      OPEN_RESULT: FIXTURES
    }
  })
  process.on('SIGTERM', () => endTest(app))
  return app
github bleenco / bterm / e2e / app.e2e.ts View on Github external
let startApplication = () => {
  return new Application({
      path: getElectronPath(),
      args: [resolve(__dirname, '../../build')],
      env: { SPECTRON: true }
    }).start();
}
github protonmail-desktop / application / e2e / utils.js View on Github external
const beforeEach = function (env = {}) {
  this.timeout(50000);
  this.app = new Application({
    path: electron,
    args: ['.', 'test'],
    startTimeout: 50000,
    waitTimeout: 50000,
    chromeDriverLogPath: process.cwd().concat('/chrome-driver.log'),
    webdriverLogPath: process.cwd(),
    env: Object.assign(env, {
      DEBUG: 'false',
      NAME: 'test',
    }),
  });

  return this.app.start();
};

spectron

Easily test your Electron apps using ChromeDriver and WebdriverIO.

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis