-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwdio.conf.js
87 lines (76 loc) · 2.26 KB
/
wdio.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* eslint import/no-extraneous-dependencies: "off" */
/* eslint no-console: "off" */
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const webpackConfig = require('./webpack.config.js');
const sauceBrowsers = require('./sauceBrowsers.conf.js');
const port = 8888;
let server;
let config = {
specs: [
'./node_modules/cspace-ui/lib/test/integration/**/*.spec.js',
'./test/integration/**/*.spec.js',
],
maxInstances: 10,
capabilities: [{
maxInstances: 5,
browserName: 'firefox',
}],
sync: true,
logLevel: 'error',
coloredLogs: true,
deprecationWarnings: true,
bail: 0,
screenshotPath: './errorShots/',
baseUrl: `http://localhost:${port}`,
waitforTimeout: 5000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: [
'selenium-standalone',
],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
compilers: ['js:babel-register'],
timeout: 40000,
},
onPrepare: () => {
server = new WebpackDevServer(webpack(webpackConfig), webpackConfig.devServer);
server.listen(port, '127.0.0.1', () => {
console.log(`Starting webpack dev server on http://localhost:${port}`);
});
},
before: () => {
// eslint-disable-next-line global-require
require('./test/integration/testParams');
// Set up chai here, so every test file doesn't have to do it.
// eslint-disable-next-line global-require
const chai = require('chai');
chai.should();
},
onComplete: () => {
server.close();
},
};
if (
process.env.TRAVIS_SECURE_ENV_VARS === 'true' &&
process.env.SAUCE_USERNAME &&
process.env.SAUCE_ACCESS_KEY
) {
// We're on Travis, and Sauce Labs environment variables are available.
// Run on the Sauce Labs cloud using the full set of browsers.
console.log('Running on Sauce Labs.');
config = Object.assign({}, config, {
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,
services: ['sauce', 'selenium-standalone'],
sauceConnect: true,
capabilities: Object.values(sauceBrowsers).map(capability => Object.assign({}, capability, {
name: 'cspace-ui-plugin-ext-ucbnh-taxon integration tests',
build: process.env.TRAVIS_BUILD_NUMBER,
})),
});
}
exports.config = config;