Created
October 17, 2015 14:31
-
-
Save klamping/f48f3167775e483e712e to your computer and use it in GitHub Desktop.
Start selenium-standalone via wdio.conf.js
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
/*global browser:false*/ | |
var selenium = require("selenium-standalone"); | |
var Promise = require("bluebird"); | |
exports.config = { | |
// Other configs go here | |
// | |
// ===== | |
// Hooks | |
// ===== | |
// Run functions before or after the test. If one of them returns with a promise, WebdriverIO | |
// will wait until that promise got resolved to continue. | |
// | |
// Gets executed before all workers get launched. | |
onPrepare: function() { | |
Promise.promisifyAll(selenium); | |
var promise = selenium.installAsync({ | |
logger: function(message) { | |
console.log(message); | |
} | |
}).then(function() { | |
console.log("Starting Selenium"); | |
return selenium.startAsync().then(function(child) { | |
selenium.child = child; | |
console.log("Selenium started"); | |
}); | |
}); | |
return promise; | |
}, | |
// | |
// Gets executed after all workers got shut down and the process is about to exit. It is not | |
// possible to defer the end of the process using a promise. | |
onComplete: function() { | |
selenium.child.kill(); | |
console.log("\nSelenium process ended. Test suite complete"); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment