diff --git a/packages/browsers/test/src/cli.spec.ts b/packages/browsers/test/src/cli.spec.ts index a36c258b..cc4554b9 100644 --- a/packages/browsers/test/src/cli.spec.ts +++ b/packages/browsers/test/src/cli.spec.ts @@ -21,12 +21,12 @@ import path from 'path'; import {CLI} from '../../lib/cjs/CLI.js'; +import {testChromeBuildId, testFirefoxBuildId} from './versions.js'; + describe('CLI', function () { this.timeout(90000); let tmpDir = '/tmp/puppeteer-browsers-test'; - const testChromeBuildId = '1083080'; - const testFirefoxBuildId = '111.0a1'; beforeEach(() => { tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test')); diff --git a/packages/browsers/test/src/fetch.spec.ts b/packages/browsers/test/src/fetch.spec.ts index 63c4b3e0..31450e96 100644 --- a/packages/browsers/test/src/fetch.spec.ts +++ b/packages/browsers/test/src/fetch.spec.ts @@ -24,14 +24,14 @@ import path from 'path'; import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js'; import {fetch, canFetch} from '../../lib/cjs/fetch.js'; +import {testChromeBuildId, testFirefoxBuildId} from './versions.js'; + /** * Tests in this spec use real download URLs and unpack live browser archives * so it requires the network access. */ describe('fetch', () => { let tmpDir = '/tmp/puppeteer-browsers-test'; - const testChromeBuildId = '1083080'; - const testFirefoxBuildId = '111.0a1'; beforeEach(() => { tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test')); diff --git a/packages/browsers/test/src/launcher.spec.ts b/packages/browsers/test/src/launcher.spec.ts index 96dedba9..1a5ad5be 100644 --- a/packages/browsers/test/src/launcher.spec.ts +++ b/packages/browsers/test/src/launcher.spec.ts @@ -23,6 +23,8 @@ import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js'; import {fetch} from '../../lib/cjs/fetch.js'; import {computeExecutablePath, launch} from '../../lib/cjs/launcher.js'; +import {testChromeBuildId, testFirefoxBuildId} from './versions.js'; + describe('launcher', () => { it('should compute executable path for Chrome', () => { assert.strictEqual( @@ -52,7 +54,6 @@ describe('launcher', () => { this.timeout(60000); let tmpDir = '/tmp/puppeteer-browsers-test'; - const testChromeBuildId = '1083080'; beforeEach(async () => { tmpDir = fs.mkdtempSync( @@ -91,7 +92,6 @@ describe('launcher', () => { this.timeout(60000); let tmpDir = '/tmp/puppeteer-browsers-test'; - const testFirefoxBuildId = '111.0a1'; beforeEach(async () => { tmpDir = fs.mkdtempSync( diff --git a/packages/browsers/test/src/versions.ts b/packages/browsers/test/src/versions.ts new file mode 100644 index 00000000..26e4caf4 --- /dev/null +++ b/packages/browsers/test/src/versions.ts @@ -0,0 +1,20 @@ +/** + * Copyright 2023 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const testChromeBuildId = '1083080'; +// TODO: We can add a Cron job to auto-update on change. +// Firefox keeps only `latest` version of Nightly builds. +export const testFirefoxBuildId = '112.0a1';