-
Notifications
You must be signed in to change notification settings - Fork 0
/
wdio.conf.js
69 lines (69 loc) · 1.65 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
exports.config = {
sync: true,
host: 'localhost',
port: 4444,
path: '/wd/hub',
specs: ['./src/test/**/*.test.js'],
maxInstances: 1,
capabilities: [{
browserName: 'chrome',
'selenoid:options': {
maxInstances: 1,
browserName: 'chrome',
platform: 'LINUX',
version: '81.0',
enableVNC: true,
screenResolution: '1920x1080x24'
},
'goog:chromeOptions': {
args: [
'--window-size=1920,1080'
]
}
}],
logLevel: 'trace',
coloredLogs: true,
deprecationWarnings: true,
bail: 0,
baseUrl: `http://${process.env.HOST}/`,
waitforTimeout: 15000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
reporters: [
[
'allure',
{
resultsDir: './allure-results',
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: true,
disableMochaHooks: true
}
]
],
mochaOpts: {
timeout: 60000,
compilers: ['ts:ts-node/register'],
require: ['source-map-support/register']
},
onPrepare: function(config, capabilities) {
require('dotenv').config()
},
before: function(capabilities, specs) {
global.reporter = require('@wdio/allure-reporter').default
const chai = require('chai')
chai.config.includeStack = true
chai.config.showDiff = true
chai.config.truncateThreshold = 0
global.expect = chai.expect
},
beforeTest: function(test, context) {
global.cache = require('memory-cache')
},
afterTest: function(test, context, { error, result, duration, passed, retries }) {
const cache = global.cache
if (cache) {
cache.clear()
}
}
}