forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
browser-providers.conf.js
75 lines (67 loc) · 2.44 KB
/
browser-providers.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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// Unique place to configure the browsers which are used in the different CI jobs in Sauce Labs (SL)
// If the target is set to null, then the browser is not run anywhere during CI.
// If a category becomes empty (e.g. BS and required), then the corresponding job must be commented
// out in the CI configuration.
const config = {
'Android13': {unitTest: {target: 'SL', required: true}},
'Android14': {unitTest: {target: 'SL', required: true}},
};
/** Whether browsers should be remotely acquired in debug mode. */
const debugMode = false;
// Karma-sauce-launcher isn't really maintained and doesn't support officially appium2
// Looking at the source code https://github.com/karma-runner/karma-sauce-launcher/blob/69dcb822a45d29e57297b0eda7af4123ae55aafd/src/process-config.ts#L60
// We can force the config to be recognized as W3C by setting a browserVersion property
const browserVersion = 'latest';
// Specific platform configuration can be found at:
// https://saucelabs.com/platform/platform-configurator
const customLaunchers = {
'SL_ANDROID13': {
base: 'SauceLabs',
platformName: 'Android',
browserName: 'Chrome',
browserVersion,
'appium:deviceName': 'Google Pixel 5a GoogleAPI Emulator',
'appium:platformVersion': '13.0',
'appium:automationName': 'uiautomator2',
'sauce:options': {
appiumVersion: '2.0.0',
extendedDebugging: debugMode,
},
},
'SL_ANDROID14': {
base: 'SauceLabs',
platformName: 'Android',
browserName: 'Chrome',
browserVersion,
'appium:deviceName': 'Google Pixel 6 Pro GoogleAPI Emulator',
'appium:platformVersion': '14.0',
'appium:automationName': 'uiautomator2',
'sauce:options': {
appiumVersion: '2.0.0',
extendedDebugging: debugMode,
},
},
};
const sauceAliases = {
'CI_REQUIRED': buildConfiguration('unitTest', 'SL', true),
'CI_OPTIONAL': buildConfiguration('unitTest', 'SL', false),
};
module.exports = {
customLaunchers: customLaunchers,
sauceAliases: sauceAliases,
};
function buildConfiguration(type, target, required) {
return Object.keys(config)
.filter((item) => {
const conf = config[item][type];
return conf.required === required && conf.target === target;
})
.map((item) => target + '_' + item.toUpperCase());
}