Skip to content

Commit

Permalink
Merge pull request #1660 from fippo/fix-interop-more
Browse files Browse the repository at this point in the history
fix interop test version naming
  • Loading branch information
fippo authored May 3, 2024
2 parents b3183c8 + c84e142 commit fba7dc3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interop-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions test/webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit fba7dc3

Please sign in to comment.