forked from googleanalytics/autotrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwdio.conf.js
103 lines (93 loc) · 2.81 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('babel-register');
exports.config = {
specs: [
'./test/index.js',
'./test/*-tracker.js',
],
maxInstances: 5,
capabilities: getCapabilities(),
sync: true,
logLevel: 'error', // silent | verbose | command | data | result | error
coloredLogs: true,
baseUrl: process.env.BASE_URL || 'http://localhost:8080',
waitforTimeout: 1e4,
connectionRetryTimeout: 3e4,
connectionRetryCount: 3,
services: ['sauce'],
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
// Ensure this is longer than the `waitForTime` setting, so timeouts point
// to individual lines rather than just tests.
timeout: 6e4,
},
}
function getCapabilities() {
// When running on CI, this will be true
var isSauceLabs = process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY;
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
var capabilities = [
{browserName: 'chrome'},
{browserName: 'firefox'},
// {browserName: 'safari'},
];
if (isSauceLabs) {
capabilities = [
{
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest',
},
{
browserName: 'firefox',
platform: 'OS X 10.11',
version: 'latest',
},
{
browserName: 'safari',
platform: 'OS X 10.11',
version: '10.0',
},
{
browserName: 'safari',
platform: 'OS X 10.11',
version: '9',
},
{
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11',
},
// TODO(philipwalton) Edge webdriver does not fully support enough of the
// webdriver features to rely on. Wait for full support and then re-add:
// https://dev.windows.com/en-us/microsoft-edge/platform/status/webdriver/details/
// {
// browserName: 'MicrosoftEdge',
// platform: 'Windows 10'
// },
];
capabilities.forEach(function(cap) {
cap['name'] = 'analytics.js autotrack tests - ' + cap.browserName +
' - ' + (cap.version || 'latest');
cap['build'] = process.env.TRAVIS_BUILD_NUMBER;
});
};
return capabilities;
}