forked from alphagov/accessible-autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwdio.config.js
More file actions
87 lines (84 loc) · 2.05 KB
/
wdio.config.js
File metadata and controls
87 lines (84 loc) · 2.05 KB
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
78
79
80
81
82
83
84
85
86
87
require('dotenv').config()
const puppeteer = require('puppeteer')
const staticServerPort = process.env.PORT || 4567
const services = [
['static-server', {
folders: [
{ mount: '/', path: './examples' },
{ mount: '/dist/', path: './dist' }
],
port: staticServerPort
}]
]
const sauceEnabled = process.env.SAUCE_ENABLED === 'true'
const sauceUser = process.env.SAUCE_USERNAME
const sauceKey = process.env.SAUCE_ACCESS_KEY
const buildNumber = process.env.SAUCE_BUILD_NUMBER
const sauceConfig = {
user: sauceUser,
key: sauceKey,
capabilities: [
{
browserName: 'chrome',
platformName: 'Windows 10',
'sauce:options': {
build: buildNumber
}
},
{
browserName: 'firefox',
browserVersion: '55',
platformName: 'Windows 10',
'sauce:options': {
build: buildNumber
}
},
{
browserName: 'internet explorer',
browserVersion: '11.285',
platformName: 'Windows 10',
'sauce:options': {
build: buildNumber
}
},
{
browserName: 'internet explorer',
browserVersion: '10',
platformName: 'Windows 7',
'sauce:options': {
build: buildNumber
}
},
/* IE9 on Sauce Labs needs to use legacy JSON Wire Protocol */
{
browserName: 'internet explorer',
version: '9',
platform: 'Windows 7',
build: buildNumber
}
],
services: services.concat([['sauce', { sauceConnect: true }]])
}
const puppeteerConfig = {
automationProtocol: 'devtools',
capabilities: [
// { browserName: 'firefox' },
{
browserName: 'chrome',
'goog:chromeOptions': {
args: ['--headless'],
binary: puppeteer.executablePath()
}
}
],
services: services
}
exports.config = Object.assign({
outputDir: './logs/',
specs: ['./test/integration/**/*.js'],
baseUrl: 'http://localhost:' + staticServerPort,
screenshotPath: './screenshots/',
reporters: ['spec'],
framework: 'mocha',
mochaOpts: { timeout: 30 * 1000 }
}, sauceEnabled ? sauceConfig : puppeteerConfig)