Skip to content

Commit

Permalink
Merge branch 'main' into watch-build-types
Browse files Browse the repository at this point in the history
  • Loading branch information
mhassan1 authored Nov 18, 2024
2 parents f361a41 + 442dba2 commit edbcac2
Show file tree
Hide file tree
Showing 3 changed files with 13,602 additions and 11,739 deletions.
69 changes: 68 additions & 1 deletion tasks/updatebrowserstacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,74 @@ if (!process.env.BROWSERSTACK_USERNAME || !process.env.BROWSERSTACK_ACCESS_KEY)
const automateClient = BrowserStack.createAutomateClient(browserStackCredentials);
const TOML = require('@iarna/toml');
const semver = require("semver");
automateClient.getBrowsers(function(error, browsers) {
automateClient.getBrowsers(function (error, browsers) {
browsers.sort((a, b) => {
if (a.browser !== b.browser) {
return a.browser.localeCompare(b.browser);
}

if (
(a.browser_version && b.browser_version) &&
a.browser_version !== b.browser_version
) {
return semver.compare(semver.coerce(a.browser_version).toString(), semver.coerce(b.browser_version).toString());
}

if (a.os !== b.os) {
return a.os.localeCompare(b.os);
}

if (
(a.os.toLowerCase() === 'windows' || a.os.toLowerCase() === 'os x') &&
(a.os_version && b.os_version) &&
a.os_version !== b.os_version
) {
// For desktop:
// Sort OS versions in reverse order.
// We want to test only one OS for each browser version.
// Newest OS first.
const a_os_version = semver.coerce(a.os_version);
const b_os_version = semver.coerce(b.os_version)

if (a_os_version && b_os_version) {
return semver.compare(b_os_version.toString(), a_os_version.toString());
}

return b.os_version.localeCompare(a.os_version);
} else if (
(a.os_version && b.os_version) &&
a.os_version !== b.os_version
) {
// For others
// Sort OS versions regularly
// We want to test only one OS for each browser version.
// Newest OS first.
const a_os_version = semver.coerce(a.os_version);
const b_os_version = semver.coerce(b.os_version)

if (a_os_version && b_os_version) {
return semver.compare(a_os_version.toString(), b_os_version.toString());
}

return a.os_version.localeCompare(b.os_version);
}

if (a.device !== b.device) {
return a.device.localeCompare(b.device);
}

return 0;
});

// Ignore non-Safari browsers on iOS
browsers = browsers.filter((browser) => {
if (browser.os === 'ios' && (browser.browser !== 'iphone' && browser.browser !== 'ipad')) {
return false;
}

return true;
});

console.log("Updated the browser list for automated testing via BrowserStack.");
fs.writeFileSync(path.join(__dirname, "../test/polyfills/browserstackBrowsers.toml"), `# This file is automatically generated via \`npm run update-browserstack-list\`
${TOML.stringify({browsers})}`);
Expand Down
44 changes: 37 additions & 7 deletions test/polyfills/browsers.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is automatically generated via `npm run update-browserstack-list`
browsers = [
# "android/6.0",
# "android/7.0",
# "android/8.0",
# "android/8.1",
Expand All @@ -10,6 +9,7 @@ browsers = [
# "android/12.0",
# "android/13.0",
# "android/14.0",
# "android/15.0",
"chrome/14.0",
"chrome/15.0",
"chrome/16.0",
Expand Down Expand Up @@ -117,7 +117,16 @@ browsers = [
"chrome/119.0",
"chrome/120.0",
"chrome/121.0",
# "chrome/122.0 beta",
"chrome/122.0",
"chrome/123.0",
"chrome/124.0",
"chrome/125.0",
"chrome/126.0",
"chrome/127.0",
"chrome/128.0",
"chrome/129.0",
"chrome/130.0",
# "chrome/131.0 beta",
"edge/15.0",
"edge/16.0",
"edge/17.0",
Expand Down Expand Up @@ -162,8 +171,17 @@ browsers = [
# "edge/118.0",
# "edge/119.0",
# "edge/120.0",
"edge/121.0", # most recent edge at the time of writing
# "edge/122.0 beta",
# "edge/121.0",
# "edge/122.0",
# "edge/123.0",
# "edge/124.0",
# "edge/125.0",
# "edge/126.0",
# "edge/127.0",
# "edge/128.0",
# "edge/129.0",
"edge/130.0", # most recent edge at the time of writing
# "edge/131.0 beta",
"firefox/3.6",
"firefox/4.0",
"firefox/5.0",
Expand Down Expand Up @@ -284,21 +302,32 @@ browsers = [
"firefox/120.0",
"firefox/121.0",
"firefox/122.0",
# "firefox/123.0 beta",
"firefox/123.0",
"firefox/124.0",
"firefox/125.0",
"firefox/126.0",
"firefox/127.0",
"firefox/128.0",
"firefox/129.0",
"firefox/130.0",
"firefox/131.0",
"firefox/132.0",
# "firefox/133.0 beta",
"ie/6.0",
"ie/7.0",
"ie/8.0",
"ie/9.0",
"ie/10.0",
"ie/11.0",
"ios/10",
# "ios/10",
"ios/11",
"ios/12",
"ios/13",
"ios/14",
"ios/15",
"ios/16",
"ios/17",
"ios/18",
"opera/12.15",
"opera/12.16",
"safari/5.1",
Expand All @@ -314,5 +343,6 @@ browsers = [
"safari/14.1",
"safari/15.6",
"safari/16.5",
"safari/17.3"
"safari/17.3",
"safari/18.0"
]
Loading

0 comments on commit edbcac2

Please sign in to comment.