forked from hltj/kotlin-web-site-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wdio.conf.js
77 lines (59 loc) · 1.64 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
const path = require('path');
const utils = require('./tests/utils');
const VisualRegressionCompare = require('wdio-visual-regression-service/compare');
const args = utils.getCLIArgs();
const dirs = utils.getVisualRegressionDirs();
const config = {
host: 'localhost',
port: 4444,
specs: [],
exclude: [],
maxInstances: 10,
// https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities
capabilities: [
{
browserName: 'chrome'
}
],
sync: true,
// silent | verbose | command | data | result | error
logLevel: 'silent',
coloredLogs: true,
baseUrl: args.baseUrl || 'http://kotlinlang.org',
// Default timeout for all waitFor* commands.
waitforTimeout: 10000,
// Default timeout in milliseconds for request if Selenium Grid doesn't send response
connectionRetryTimeout: 90000,
// Default request retries count
connectionRetryCount: 3,
plugins: {
'wdio-screenshot': {},
},
services: [
'visual-regression'
],
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
// http://webdriver.io/guide/testrunner/reporters.html
reporters: ['spec'],
// Hooks
before: function (capabilities, specs) {
const chai = require('chai');
chai.should();
},
visualRegression: {
compare: new VisualRegressionCompare.LocalCompare({
referenceName: utils.screenshotNameGenerator(dirs.reference),
screenshotName: utils.screenshotNameGenerator(dirs.current),
diffName: utils.screenshotNameGenerator(dirs.diff),
misMatchTolerance: 0.01,
}),
viewportChangePause: 300,
widths: [1280],
orientations: ['landscape'],
},
};
exports.config = config;