-
Notifications
You must be signed in to change notification settings - Fork 139
/
wdio.ci.conf.js
71 lines (65 loc) · 1.83 KB
/
wdio.ci.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
const { spawnSync } = require('child_process');
const branchName = require('current-git-branch');
const { config: defaultConfig, isMobile, imageComparisonService } = require('./wdio.conf');
const {
projectName,
capabilities: browserStackCapabilities
} = require('./test/conf/browserstack');
const {
BROWSER = 'Chrome-Remote',
BROWSER_STACK_USERNAME: user,
BROWSER_STACK_ACCESS_KEY: key,
GITHUB_RUN_ID
} = process.env;
const BROWSER_STACK_CAPABILITY = browserStackCapabilities[BROWSER];
const localIdentifier = `${Math.round(Math.random() * 100)}-${Date.now()}`;
const { timeout } = defaultConfig.mochaOpts;
spawnSync('mkdir', ['-p', 'build/reports/e2e/log'] );
const services = [
['browserstack', {
browserstackLocal: true,
opts: {
logfile: 'build/reports/e2e/log/browserstack.log',
localIdentifier
}
}],
imageComparisonService()
]
if (BROWSER === 'Electron') {
exports.config = defaultConfig;
} else {
const config = exports.config = Object.assign({}, defaultConfig, {
user,
key,
capabilities: [
{
browserName: BROWSER_STACK_CAPABILITY.browserName,
'bstack:options': Object.assign(
{},
BROWSER_STACK_CAPABILITY,
{
projectName,
buildName: `${GITHUB_RUN_ID || `Local e2e [${branchName()}]`}`,
seleniumVersion: '3.141.59',
appiumVersion: '1.17.0',
local: true,
debug: true,
networkLogs: true,
consoleLogs: 'verbose',
localIdentifier
}
)
}
],
baseUrl: 'http://bs-local.com:9877',
maxInstances: 1,
services,
onPrepare: () => {
if (isMobile()) {
process.env.API_PROXY = 'http://bs-local.com:9877/api-proxy';
}
require('@recurly/public-api-test-server');
}
});
delete config.path;
}