-
Notifications
You must be signed in to change notification settings - Fork 45
/
karma.conf.sauce.js
121 lines (118 loc) · 3.71 KB
/
karma.conf.sauce.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* eslint-disable camelcase */
module.exports = function (config) {
// TODO: figure out Safari error where socket gets disconnected during the test.
// https://saucelabs.com/platforms
var customLaunchers = {
SL_Chrome: {
base: "SauceLabs",
browserName: "chrome",
version: "45"
},
SL_Chrome_Latest: {
base: "SauceLabs",
browserName: "chrome",
version: "46"
},
SL_Firefox: {
base: "SauceLabs",
browserName: "firefox",
version: "41"
},
SL_Firefox_Latest: {
base: "SauceLabs",
browserName: "firefox",
version: "42"
},
SL_iOS8_Safari: {
base: "SauceLabs",
browserName: "iphone",
platform: "OS X 10.10",
version: "8.4"
},
SL_iOS9_Safari: {
base: "SauceLabs",
browserName: "iphone",
platform: "OS X 10.10",
version: "9.1"
},
SL_OSX_Safari8: {
base: "SauceLabs",
browserName: "safari",
platform: "OS X 10.10",
version: "8"
},
SL_OSX_Safari9: {
base: "SauceLabs",
browserName: "safari",
platform: "OS X 10.11",
version: "9"
},
SL_InternetExplorer10: {
base: "SauceLabs",
browserName: "internet explorer",
platform: "Windows 8",
version: "10"
},
SL_InternetExplorer11: {
base: "SauceLabs",
browserName: "internet explorer",
platform: "Windows 8.1",
version: "11"
},
SL_Edge: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "20"
},
SL_ANDROID4: {
base: "SauceLabs",
browserName: "android",
platform: "Linux",
version: "4.4"
},
SL_ANDROID5: {
base: "SauceLabs",
browserName: "android",
platform: "Linux",
version: "5.0"
}
};
// "saucelabs" reporter is necessary for their status badge to reflect the test result.
config.set({
captureTimeout: 120000,
browserNoActivityTimeout: 120000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
sauceLabs: {
testName: "React Metrics",
startConnect: true,
recordVideo: false,
recordScreenshots: false
},
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers)
});
if (process.env.DEBUG_SAUCE) {
config.sauceLabs.connectOptions = {
port: 5050,
verbose: true,
doctor: true
};
}
if (process.env.TRAVIS) {
if (process.env.TRAVIS_PULL_REQUEST !== "false" || process.env.TRAVIS_BRANCH !== "master") {
process.env.SAUCE_USERNAME = process.env.SAUCE_USERNAME_PR;
process.env.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY_PR;
}
console.log("SAUCE_USERNAME: ", process.env.SAUCE_USERNAME);
// Sauce Connect through "karma-sauce-launcher" doesn"t work on Travis, manually run Sauce Connect
config.sauceLabs.startConnect = false;
config.sauceLabs.connectOptions = {
port: 5050
};
config.sauceLabs.build = "TRAVIS #" + process.env.TRAVIS_BUILD_NUMBER + " (" + process.env.TRAVIS_BUILD_ID + ")";
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
config.reporters = ["dots", "saucelabs"];
}
};