Skip to content

Instantly share code, notes, and snippets.

@beatfactor
Created August 25, 2015 19:55
Show Gist options
  • Save beatfactor/555587fde4a3c411229e to your computer and use it in GitHub Desktop.
Save beatfactor/555587fde4a3c411229e to your computer and use it in GitHub Desktop.
chromedriver
var chromedriver = require('chromedriver');
var moduleFolder = '../../node_modules/chromedriver/lib/chromedriver/';
var path = require('path');
var binPath = path.resolve(path.join(moduleFolder, process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver'));
module.exports = {
defaultInstance : null,
start : function() {
this.defaultInstance = require('child_process').execFile(binPath, [
'--url-base=/wd/hub'
]);
return this.defaultInstance;
},
stop : function () {
if (this.defaultInstance != null){
this.defaultInstance.kill();
}
}
};
var chromedriver = require('./chromedriver.js');
module.exports = {
before: function (done) {
chromedriver.start();
done();
},
after : function(done) {
chromedriver.stop();
done();
}
};
{
"chrome" : {
"selenium" : {
"start_process" : false
},
"selenium_port" : 9515,
"desiredCapabilities": {
"browserName": "chrome"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment