Better onPrepare for wdio

This commit is contained in:
orangemug 2018-04-09 10:20:37 +01:00
parent 1de7ba7e86
commit dbe2c2637e

View file

@ -38,9 +38,22 @@ exports.config = {
timeout: 4*60*1000 timeout: 4*60*1000
}, },
onPrepare: function (config, capabilities) { onPrepare: function (config, capabilities) {
var compiler = webpack(webpackConfig); return new Promise(function(resolve, reject) {
server = new WebpackDevServer(compiler, {}); var compiler = webpack(webpackConfig);
server.listen(testConfig.port); server = new WebpackDevServer(compiler, {
stats: {
colors: true
}
});
server.listen(testConfig.port, "127.0.0.1", function(err) {
if(err) {
reject();
}
else {
resolve();
}
});
})
}, },
onComplete: function(exitCode) { onComplete: function(exitCode) {
server.close() server.close()