2016-10-05 03:39:20 +00:00
/ * *
* @ license
2020-05-19 19:08:49 +00:00
* Copyright Google LLC All Rights Reserved .
2016-10-05 03:39:20 +00:00
*
* Use of this source code is governed by an MIT - style license that can be
2024-09-20 15:23:15 +00:00
* found in the LICENSE file at https : //angular.dev/license
2016-10-05 03:39:20 +00:00
* /
// Unique place to configure the browsers which are used in the different CI jobs in Sauce Labs (SL)
2015-12-10 13:40:00 +00:00
// If the target is set to null, then the browser is not run anywhere during CI.
2016-10-05 03:39:20 +00:00
// If a category becomes empty (e.g. BS and required), then the corresponding job must be commented
2019-01-08 11:41:24 +00:00
// out in the CI configuration.
2021-11-25 19:07:49 +00:00
const config = {
2024-05-07 22:33:43 +00:00
'Android13' : { unitTest : { target : 'SL' , required : true } } ,
'Android14' : { unitTest : { target : 'SL' , required : true } } ,
2015-12-10 13:40:00 +00:00
} ;
2021-11-25 19:07:49 +00:00
/** Whether browsers should be remotely acquired in debug mode. */
const debugMode = false ;
2024-05-07 22:33:43 +00:00
// 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' ;
2022-05-08 21:38:17 +00:00
// Specific platform configuration can be found at:
// https://saucelabs.com/platform/platform-configurator
2021-11-25 19:07:49 +00:00
const customLaunchers = {
2024-05-07 22:33:43 +00:00
'SL_ANDROID13' : {
2020-02-06 23:50:14 +00:00
base : 'SauceLabs' ,
2021-11-25 19:07:49 +00:00
platformName : 'Android' ,
2024-05-07 22:33:43 +00:00
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 ,
} ,
2020-02-06 23:50:14 +00:00
} ,
2024-05-07 22:33:43 +00:00
'SL_ANDROID14' : {
2020-02-06 23:50:14 +00:00
base : 'SauceLabs' ,
2021-11-25 19:07:49 +00:00
platformName : 'Android' ,
2024-05-07 22:33:43 +00:00
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 ,
} ,
2020-02-06 23:50:14 +00:00
} ,
2015-06-02 14:29:09 +00:00
} ;
2021-11-25 19:07:49 +00:00
const sauceAliases = {
2015-12-10 13:40:00 +00:00
'CI_REQUIRED' : buildConfiguration ( 'unitTest' , 'SL' , true ) ,
'CI_OPTIONAL' : buildConfiguration ( 'unitTest' , 'SL' , false ) ,
2015-06-02 14:29:09 +00:00
} ;
module . exports = {
2022-05-08 21:38:17 +00:00
customLaunchers : customLaunchers ,
sauceAliases : sauceAliases ,
2016-04-29 00:50:03 +00:00
} ;
2015-12-10 13:40:00 +00:00
function buildConfiguration ( type , target , required ) {
2021-11-25 19:07:49 +00:00
return Object . keys ( config )
2016-10-05 03:39:20 +00:00
. filter ( ( item ) => {
2021-11-25 19:07:49 +00:00
const conf = config [ item ] [ type ] ;
2016-10-05 03:39:20 +00:00
return conf . required === required && conf . target === target ;
} )
. map ( ( item ) => target + '_' + item . toUpperCase ( ) ) ;
2015-12-10 13:40:00 +00:00
}