-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.js
52 lines (47 loc) · 1.44 KB
/
base.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
// Fundamental Configurations, find the full list at - http://webdriver.io/guide/testrunner/configurationfile.html.
const path = require('path');
const chai = require('chai');
const chromeLocation = require('chrome-location');
// Tips for debug - http://webdriver.io/guide/testrunner/debugging.html.
const isDebug = process.env.DEBUG;
const isHeadless = process.env.HEADLESS;
const chromeArgs = [
// Use iPhone 6, 6s, 7, 8 's resolution as default.
// https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
'--window-size=375,667',
];
if (isHeadless) {
chromeArgs.push('--headless', '--disable-gpu');
}
const base = {
specs: [
'./tests/pages/*.js',
],
capabilities: [{
browserName: 'chrome',
chromeOptions: {
args: chromeArgs,
binary: chromeLocation,
}
}],
maxInstances: isDebug ? 1 : 10,
logLevel: 'command',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: 'http://127.0.0.1:8099',
waitforTimeout: 10000,
connectionRetryTimeout: 10000,
services: ['selenium-standalone'],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: isDebug ? 99999999 : 30000,
},
before() {
// Inject chai to global - http://webdriver.io/guide/testrunner/frameworks.html#Using-Mocha
global.expect = chai.expect;
chai.Should();
},
};
module.exports.config = base;