/
wdio.conf.js
92 lines (84 loc) · 2.73 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
88
89
90
91
92
const seleniumVersions = {
// check for more recent versions of selenium here:
// https://selenium-release.storage.googleapis.com/index.html
version: '3.141.59',
baseURL: 'https://selenium-release.storage.googleapis.com',
drivers: {
chrome: {
// check for more recent versions of chrome driver here:
// https://chromedriver.storage.googleapis.com/index.html
version: '86.0.4240.22',
arch: process.arch,
baseURL: 'https://chromedriver.storage.googleapis.com',
},
firefox: {
// check for more recent versions of geckodriver here:
// https://github.com/mozilla/geckodriver/releases/
version: '0.27.0',
arch: process.arch,
baseURL: 'https://github.com/mozilla/geckodriver/releases/download',
},
},
};
exports.config = {
runner: 'local',
specs: ['./tests/**/*.test.js'],
exclude: [],
maxInstances: 5,
// NOTE: capabilities are set at the bottom of the file instead!
//capabilities: [],
sync: false,
// Level of logging verbosity: silent | verbose | command | data | result | error
logLevel: process.env.E2E_LOG_LEVEL || 'error',
bail: 0,
baseUrl: 'http://127.0.0.1:3000',
waitforTimeout: 5000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: ['selenium-standalone'],
seleniumArgs: seleniumVersions,
seleniumInstallArgs: seleniumVersions,
framework: 'jasmine',
reporters: ['spec'],
jasmineNodeOpts: {
defaultTimeoutInterval: 30000,
},
before: function (capabilities, specs) {
// eslint-disable-next-line no-undef
browser.setTimeout({ implicit: 5000 });
// eslint-disable-next-line no-undef
browser.setTimeout({ script: 5000 });
},
};
exports.config.capabilities = [
{
browserName: 'chrome',
'goog:chromeOptions': {},
},
{
browserName: 'firefox',
'moz:firefoxOptions': {},
},
];
if (process.env.SELENIUM_BROWSER) {
exports.config.capabilities = exports.config.capabilities.filter(
(conf) => conf.browserName === process.env.SELENIUM_BROWSER
);
}
if (process.env.E2E_HEADLESS) {
const chromeCapability = exports.config.capabilities.find((conf) => conf.browserName === 'chrome');
if (chromeCapability) {
chromeCapability['goog:chromeOptions'] = Object.assign(chromeCapability['goog:chromeOptions'], {
args: ['--headless', '--disable-gpu', '--window-size=1280,800'],
});
}
const firefoxCapability = exports.config.capabilities.find((conf) => conf.browserName === 'firefox');
if (firefoxCapability) {
firefoxCapability['moz:firefoxOptions'] = Object.assign(firefoxCapability['moz:firefoxOptions'], {
args: ['-headless', '--window-size=1280,800'],
});
}
}
if (process.env.E2E_WDIO_EXEC_ARGV) {
exports.config.execArgv = [process.env.E2E_WDIO_EXEC_ARGV];
}