forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wdio.conf.js
51 lines (47 loc) · 1.46 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
const shared = require('./wdio.shared.conf.js');
const browsers = Object.fromEntries(
Object.entries(require('./browsers.json'))
.filter(([k, v]) => {
// run only on latest; exclude Safari
// (Webdriver's `browser.url(...)` times out on Safari if the page loads a video; does it wait for playback to complete?)
return v.browser_version === 'latest' && v.browser !== 'safari'
})
);
function getCapabilities() {
function getPlatform(os) {
const platformMap = {
'Windows': 'WINDOWS',
'OS X': 'OS X',
}
return platformMap[os];
}
let capabilities = []
Object.values(browsers).forEach(browser => {
capabilities.push({
browserName: browser.browser,
browserVersion: browser.browser_version,
'bstack:options': {
os: getPlatform(browser.os),
osVersion: browser.os_version,
networkLogs: true,
consoleLogs: 'verbose',
buildName: `Prebidjs E2E (${browser.browser} ${browser.browser_version}) ${new Date().toLocaleString()}`
},
acceptInsecureCerts: true,
});
});
return capabilities;
}
exports.config = {
...shared.config,
services: [
['browserstack', {
browserstackLocal: true
}]
],
user: process.env.BROWSERSTACK_USERNAME,
key: process.env.BROWSERSTACK_ACCESS_KEY,
maxInstances: 5, // Do not increase this, since we have only 5 parallel tests in browserstack account
maxInstancesPerCapability: 1,
capabilities: getCapabilities(),
}