From c84e142c3bcfd356c722f8b6ee102b1eaa5137c7 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 2 May 2024 08:06:12 -0700 Subject: [PATCH] fix interop test version naming travis-multirunner was mapping "unstable" to dev/nightly for Chrome and Firefox. Do the same here. --- .github/workflows/interop-tests.yml | 2 +- test/webdriver.js | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/interop-tests.yml b/.github/workflows/interop-tests.yml index eb2328ee7..68d4c46f6 100644 --- a/.github/workflows/interop-tests.yml +++ b/.github/workflows/interop-tests.yml @@ -11,7 +11,7 @@ jobs: matrix: browserA: [chrome, firefox] browserB: [firefox, chrome] - bver: ['unstable'] + bver: [unstable] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 diff --git a/test/webdriver.js b/test/webdriver.js index b165c3689..c39054bdc 100644 --- a/test/webdriver.js +++ b/test/webdriver.js @@ -35,10 +35,23 @@ if (os.platform() === 'win32') { process.env.PATH += ':node_modules/.bin'; } +function mapVersion(browser, version) { + const versionMap = { + chrome: { + unstable: 'dev', + }, + firefox: { + unstable: 'nightly', + } + }; + return (versionMap[browser] || {})[version] || version; +} + async function buildDriver(browser = process.env.BROWSER || 'chrome', options = {version: process.env.BVER}) { + const version = mapVersion(options.version); const platform = puppeteerBrowsers.detectBrowserPlatform(); - const buildId = await download(browser, options.version || 'stable', + const buildId = await download(browser, version || 'stable', cacheDir, platform); // Chrome options. @@ -88,7 +101,7 @@ async function buildDriver(browser = process.env.BROWSER || 'chrome', options = // Safari options. const safariOptions = new safari.Options(); - safariOptions.setTechnologyPreview(options.version === 'unstable'); + safariOptions.setTechnologyPreview(version === 'unstable'); // Firefox options. const firefoxOptions = new firefox.Options();