-
Notifications
You must be signed in to change notification settings - Fork 1
/
wdio.conf.js
98 lines (87 loc) · 2.12 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
require('dotenv').config()
var browserstack = require('browserstack-local');
exports.config = {
user: process.env.BROWSERSTACK_USERNAME,
key: process.env.BROWSERSTACK_KEY,
updateJob: false,
specs: [
'./src/**/e2e.test.js'
],
exclude: [],
commonCapabilities: {
name: 'local_parallel_test',
build: 'webdriver-browserstack',
'browserstack.local': true
},
capabilities: [
{
browser: 'chrome',
'browser_version': '60.0',
},
{
browser: 'chrome',
'browser_version': '55.0',
},
{
browser: 'firefox',
'browser_version': '55.0',
},
{
browser: 'firefox',
'browser_version': '46.0',
},
{
browser: 'internet explorer',
'browser_version': '11.0',
},
{
'browser': 'Safari',
'browser_version': '10.0',
},
{
'browser': 'Edge',
'browser_version': '15.0',
},
{
'browser': 'Edge',
'browser_version': '14.0',
}
],
logLevel: 'verbose',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
mochaOpts: {
ui: 'bdd'
},
// Code to start browserstack local before start of test
onPrepare: function (config, capabilities) {
console.log("Connecting local");
return new Promise(function(resolve, reject){
exports.bs_local = new browserstack.Local();
exports.bs_local.start({'key': exports.config.key }, function(error) {
if (error) return reject(error);
console.log('Connected. Now testing...');
resolve();
});
});
},
// Code to stop browserstack local after end of test
onComplete: function (capabilties, specs) {
exports.bs_local.stop(function() {});
},
// Add Chai
before: function() {
var chai = require('chai');
global.expect = chai.expect;
chai.Should();
}
};
// Code to support common capabilities
exports.config.capabilities.forEach(function(caps){
for(var i in exports.config.commonCapabilities) caps[i] = caps[i] || exports.config.commonCapabilities[i];
})