Skip to content

Commit

Permalink
ci: Update Saucelabs config to use Andoid 13 and 14
Browse files Browse the repository at this point in the history
This will allow us to run the test against versions closer to supported targets.
  • Loading branch information
JeanMeche committed May 8, 2024
1 parent 42b4fa9 commit 323772d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
43 changes: 29 additions & 14 deletions browser-providers.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,48 @@
// If a category becomes empty (e.g. BS and required), then the corresponding job must be commented
// out in the CI configuration.
const config = {
'Android11': {unitTest: {target: 'SL', required: true}},
'Android12': {unitTest: {target: 'SL', required: true}},
'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_ANDROID11': {
'SL_ANDROID13': {
base: 'SauceLabs',
browserName: 'Chrome',
platformName: 'Android',
platformVersion: '11.0',
deviceName: 'Google Pixel 3a GoogleAPI Emulator',
appiumVersion: '1.20.2',
extendedDebugging: debugMode,
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_ANDROID12': {

'SL_ANDROID14': {
base: 'SauceLabs',
browserName: 'Chrome',
platformName: 'Android',
platformVersion: '12.0',
deviceName: 'Google Pixel 4a (5G) GoogleAPI Emulator',
appiumVersion: '1.22.1',
extendedDebugging: debugMode,
browserName: 'Chrome',
browserVersion,

'appium:deviceName': 'Google Pixel 8 Pro GoogleAPI Emulator',
'appium:platformVersion': '14.0',
'appium:automationName': 'uiautomator2',
'sauce:options': {
appiumVersion: '2.0.0',
extendedDebugging: debugMode,
},
},
};

Expand Down
33 changes: 10 additions & 23 deletions packages/common/test/i18n/format_number_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,15 @@ describe('Format number', () => {
// We know this test fails on Saucelabs/Android
// because it runs a rather old version of Chrome (m100)
// that doesn't support the default number of digits of 0 for GNF
if (!isAndroid()) {
// GNF has a default number of digits of 0
expect(formatCurrency(5.1234, ɵDEFAULT_LOCALE_ID, 'GNF', 'GNF')).toEqual('GNF 5');
expect(formatCurrency(5.1234, ɵDEFAULT_LOCALE_ID, 'GNF', 'GNF', '.2')).toEqual(
'GNF 5.12',
);
expect(formatCurrency(5.1234, ɵDEFAULT_LOCALE_ID, 'Custom name', 'GNF')).toEqual(
'Custom name 5',
);
}

// GNF has a default number of digits of 0
expect(formatCurrency(5.1234, ɵDEFAULT_LOCALE_ID, 'GNF', 'GNF')).toEqual('GNF 5');
expect(formatCurrency(5.1234, ɵDEFAULT_LOCALE_ID, 'GNF', 'GNF', '.2')).toEqual(
'GNF 5.12',
);
expect(formatCurrency(5.1234, ɵDEFAULT_LOCALE_ID, 'Custom name', 'GNF')).toEqual(
'Custom name 5',
);

// BHD has a default number of digits of 3
expect(formatCurrency(5.1234, ɵDEFAULT_LOCALE_ID, 'BHD', 'BHD')).toEqual('BHD 5.123');
Expand All @@ -219,16 +218,4 @@ describe('Format number', () => {
});
});
});
});

// Temporary helper until test runners are up-to-date
// TODO: remove once test runners are up-to-date
function isAndroid() {
if (isNode) return false;

const userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('android') != -1) {
return true;
}
return false;
}
});

0 comments on commit 323772d

Please sign in to comment.