-
-
Notifications
You must be signed in to change notification settings - Fork 729
/
karma.custom-launchers.config.js
227 lines (223 loc) · 5.02 KB
/
karma.custom-launchers.config.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
const sample = require('lodash.sample');
const argv = require('minimist')(process.argv.slice(2));
const customLaunchers = {
bs_sierra_safari_10: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '10.0',
browser: 'safari',
os_version: 'Sierra',
},
bs_sierra_safari_11: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '11.1',
browser: 'safari',
os_version: 'High Sierra',
},
bs_mojave_safari_12: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '12.1',
browser: 'safari',
os_version: 'Mojave',
},
bs_catalina_safari_13: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '13.1',
browser: 'safari',
os_version: 'Catalina',
},
bs_bigsur_safari_14: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '14.1',
browser: 'safari',
os_version: 'Big Sur',
},
bs_monterey_safari_15: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '15.6',
browser: 'safari',
os_version: 'Monterey',
},
bs_ventura_safari_16: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '16.5',
browser: 'safari',
os_version: 'Ventura',
},
bs_sonoma_safari_17: {
base: 'BrowserStack',
device: null,
os: 'OS X',
browser_version: '17.0',
browser: 'safari',
os_version: 'Sonoma',
},
bs_win10_edge_84: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '84.0',
browser: 'edge',
os_version: '10',
},
bs_win10_firefox_70: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '70.0',
browser: 'firefox',
os_version: '10',
},
bs_win10_firefox_80: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '80.0',
browser: 'firefox',
os_version: '10',
},
bs_win10_firefox_89: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '89.0',
browser: 'firefox',
os_version: '10',
},
bs_win10_firefox_94: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '94.0',
browser: 'firefox',
os_version: '10',
},
bs_win10_firefox_108: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '108.0',
browser: 'firefox',
os_version: '10',
},
bs_win10_firefox_120: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '120.0',
browser: 'firefox',
os_version: '11',
},
bs_win10_firefox_125: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '125.0',
browser: 'firefox',
os_version: '11',
},
bs_win10_chrome_60: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '60.0',
browser: 'chrome',
os_version: '10',
},
bs_win10_chrome_70: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '70.0',
browser: 'chrome',
os_version: '10',
},
bs_win10_chrome_85: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '85.0',
browser: 'chrome',
os_version: '10',
},
bs_win10_chrome_91: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '91.0',
browser: 'chrome',
os_version: '10',
},
bs_win10_chrome_96: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '96.0',
browser: 'chrome',
os_version: '10',
},
bs_win10_chrome_108: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '108.0',
browser: 'chrome',
os_version: '10',
},
bs_win10_chrome_120: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '120.0',
browser: 'chrome',
os_version: '11',
},
bs_win10_chrome_124: {
base: 'BrowserStack',
device: null,
os: 'Windows',
browser_version: '124.0',
browser: 'chrome',
os_version: '11',
},
};
const getAllBrowsers = () => Object.keys(customLaunchers);
const getRandomBrowser = () => sample(getAllBrowsers());
/**
* Environment variables are passed into the script and the depth of testing
* is affected accordingly.
*
* - Whenever on a PR we only want to probe test with Firefox
* - Whenever we are on the most recent node version on GitHub Actions we test via BrowserStack
* - If none of the prior mentioned holds we assume to be running local and respect the passed
* in browsers argv
*/
const shouldProbeOnly = argv.shouldProbeOnly === 'true';
const shouldTestOnBrowserStack = argv.shouldTestOnBrowserStack === 'true';
const defaultBrowsers = ['Firefox'];
const argvBrowsers = Array.isArray(argv.browsers)
? argv.browsers.split(' ')
: defaultBrowsers;
const browsers = shouldTestOnBrowserStack
? shouldProbeOnly
? defaultBrowsers
: getAllBrowsers()
: argvBrowsers;
module.exports = {
customLaunchers,
browsers,
getRandomBrowser,
};