How to use the selenium-download.ensure function in selenium-download

To help you get started, we’ve selected a few selenium-download 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 multivoltage / adflyroboTOR / nightwatch.conf.js View on Github external
require('fs').stat(BINPATH + 'selenium.jar', function (err, stat) { // got it?
  if (err || !stat || stat.size < 1) {
    require('selenium-download').ensure(BINPATH, function(error) {
      if (error) throw new Error(error); // no point continuing so exit!
      console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH);
    });
  }
});
github be-fe / lazy-assert / examples / 5-nightwatch / nightwatch.config.js View on Github external
require('fs').stat(SELENIUM_PATH, function (err, stat) { // got it?
    if (err || !stat || stat.size < 1) {
        require('selenium-download').ensure(BINPATH, function (error) {
            if (error) throw new Error(error); // no point continuing so exit!
            console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH);
        });
    }
});
github opencollective / opencollective-website / nightwatch.conf.js View on Github external
require('fs').stat(`${BINPATH}selenium.jar`, (err, stat) => { // got it?
  if (err || !stat || stat.size < 1) {
  console.log("???", `${BINPATH}selenium.jar`, stat, err);
    require('selenium-download').ensure(BINPATH, (error) => {
      console.log("???", "error:", error);
      if (error) throw new Error(error); // no point continuing so exit!
      console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH);
    });
  }
});
github mobify / nightwatch-commands / selenium / install.js View on Github external
var fs = require('fs');
var mkdirp = require('mkdirp');
var path = require('path');
var selenium = require('selenium-download');

// Download Selenium server and Chromedriver
selenium.ensure(__dirname, function(error) {
    if (error) {
        console.error(error.stack);
    } else {
        // Rename so that we don't need to update paths in project configs
        var oldSeleniumPath = path.join(__dirname, 'selenium.jar');
        var newSeleniumPath = path.join(__dirname, 'selenium-server.jar');
        
        fs.rename(oldSeleniumPath, newSeleniumPath, function(error) {
            if (error) console.log(error);
            return;
        });

        mkdirp(path.join(__dirname, 'drivers'));
        var oldChromedriverPath = path.join(__dirname, 'chromedriver');
        var newChromedriverPath = path.join(__dirname, 'drivers', 'chromedriver');
github binary-com / webtrader / nightwatch.conf.js View on Github external
require('fs').stat(BINPATH + 'selenium.jar', function (err, stat) { // got it?
  if (err || !stat || stat.size < 1) {
    require('selenium-download').ensure(BINPATH, function (error) {
      if (error) throw new Error(error); // no point continuing so exit!
      console.log('✔ Selenium & chrome driver downloaded to:', BINPATH);
    });
  }
});
github nodox / gatsby-theme-kit / nightwatch.conf.js View on Github external
require('fs').stat(BINPATH + 'selenium.jar', function (err, stat) { // got it?
  if (err || !stat || stat.size < 1) {
    require('selenium-download').ensure(BINPATH, function(error) {
      if (error) console.log(error); // no point continuing so exit!
      console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH);
    });
  }
});
github developer239 / react-apollo-graphql / nightwatch.conf.js View on Github external
require('fs').stat(BINPATH + 'selenium.jar', function (err, stat) { // eslint-disable-line
  if (err || !stat || stat.size < 1) {
    require('selenium-download').ensure(BINPATH, function (error) { // eslint-disable-line
      if (error) throw new Error(error) // no point continuing so exit!
      console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH)
    })
  }
})
github dwyl / learn-nightwatch / bin / selenium_child_process.js View on Github external
const selenium = require('selenium-download');
const execSync = require('child_process').execSync;
const get = require('http').get;

selenium.ensure('./bin', function(error) {
  if (error) {
    throw new Error(error);
  } else {
    return start();
  }
});

function start () {
  get('http://localhost:4444/wd/hub/status', function (res) {
    if (res && res.statusCode === 200){
      res.on("data", function(chunk) {
        console.log('Selenium is running:',
          JSON.stringify(JSON.parse(chunk), null, 2));
        return; // res.end is automatically called.
      });
    }
github binary-com / webtrader / nightwatch.conf.js View on Github external
require('fs').stat(BINPATH + 'selenium.jar', function (err, stat) { // got it?
  if (err || !stat || stat.size < 1) {
    require('selenium-download').ensure(BINPATH, function (error) {
      if (error) throw new Error(error); // no point continuing so exit!
      console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH);
    });
  }
});
github stone-payments / emerald-web-framework / selenium-setup.js View on Github external
const selenium = require('selenium-download');
const path = require('path');

selenium.ensure(path.join(__dirname, 'bin'), () => {
  process.exit(0);
});

selenium-download

allow downloading of latest selenium standalone server and chromedriver

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Popular selenium-download functions

Similar packages