maputnik/config/wdio.conf.js

72 lines
1.6 KiB
JavaScript
Raw Normal View History

2017-04-04 16:51:30 +02:00
var webpack = require("webpack");
var WebpackDevServer = require("webpack-dev-server");
2018-03-06 22:11:58 +01:00
var webpackConfig = require("./webpack.config");
2017-04-04 17:03:02 +02:00
var testConfig = require("../test/config/specs");
var artifacts = require("../test/artifacts");
var isDocker = require("is-docker");
2017-04-04 16:51:30 +02:00
var server;
var SCREENSHOT_PATH = artifacts.pathSync("screenshots");
2017-04-04 16:51:30 +02:00
exports.config = {
runner: 'local',
path: '/wd/hub',
specs: [
'./test/functional/index.js'
],
maxInstances: 10,
capabilities: [
{
maxInstances: 5,
browserName: (process.env.BROWSER || 'chrome'),
}
],
logLevel: 'info',
bail: 0,
screenshotPath: SCREENSHOT_PATH,
hostname: process.env.DOCKER_HOST || "0.0.0.0",
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
// Because we don't know how long the initial build will take...
timeout: 4*60*1000,
},
onPrepare: function (config, capabilities) {
return new Promise(function(resolve, reject) {
var compiler = webpack(webpackConfig);
const serverHost = "0.0.0.0";
server = new WebpackDevServer(compiler, {
host: serverHost,
disableHostCheck: true,
stats: {
colors: true
}
});
server.listen(testConfig.port, serverHost, function(err) {
if(err) {
reject(err);
}
else {
resolve();
}
});
})
},
onComplete: function(exitCode) {
return new Promise(function(resolve, reject) {
server.close(function (err) {
if (err) {
reject(err)
}
else {
resolve();
}
2019-06-08 07:04:41 +02:00
})
});
}
2017-04-04 16:51:30 +02:00
}