Created
August 25, 2015 19:55
-
-
Save beatfactor/555587fde4a3c411229e to your computer and use it in GitHub Desktop.
chromedriver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chromedriver = require('./chromedriver.js'); | |
module.exports = { | |
before: function (done) { | |
chromedriver.start(); | |
done(); | |
}, | |
after : function(done) { | |
chromedriver.stop(); | |
done(); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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