mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: fix Browsers failing tests (#9768)
This commit is contained in:
parent
2922611f5e
commit
3a4e726078
@ -21,12 +21,12 @@ import path from 'path';
|
|||||||
|
|
||||||
import {CLI} from '../../lib/cjs/CLI.js';
|
import {CLI} from '../../lib/cjs/CLI.js';
|
||||||
|
|
||||||
|
import {testChromeBuildId, testFirefoxBuildId} from './versions.js';
|
||||||
|
|
||||||
describe('CLI', function () {
|
describe('CLI', function () {
|
||||||
this.timeout(90000);
|
this.timeout(90000);
|
||||||
|
|
||||||
let tmpDir = '/tmp/puppeteer-browsers-test';
|
let tmpDir = '/tmp/puppeteer-browsers-test';
|
||||||
const testChromeBuildId = '1083080';
|
|
||||||
const testFirefoxBuildId = '111.0a1';
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test'));
|
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test'));
|
||||||
|
@ -24,14 +24,14 @@ import path from 'path';
|
|||||||
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||||
import {fetch, canFetch} from '../../lib/cjs/fetch.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
|
* Tests in this spec use real download URLs and unpack live browser archives
|
||||||
* so it requires the network access.
|
* so it requires the network access.
|
||||||
*/
|
*/
|
||||||
describe('fetch', () => {
|
describe('fetch', () => {
|
||||||
let tmpDir = '/tmp/puppeteer-browsers-test';
|
let tmpDir = '/tmp/puppeteer-browsers-test';
|
||||||
const testChromeBuildId = '1083080';
|
|
||||||
const testFirefoxBuildId = '111.0a1';
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test'));
|
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test'));
|
||||||
|
@ -23,6 +23,8 @@ import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
|||||||
import {fetch} from '../../lib/cjs/fetch.js';
|
import {fetch} from '../../lib/cjs/fetch.js';
|
||||||
import {computeExecutablePath, launch} from '../../lib/cjs/launcher.js';
|
import {computeExecutablePath, launch} from '../../lib/cjs/launcher.js';
|
||||||
|
|
||||||
|
import {testChromeBuildId, testFirefoxBuildId} from './versions.js';
|
||||||
|
|
||||||
describe('launcher', () => {
|
describe('launcher', () => {
|
||||||
it('should compute executable path for Chrome', () => {
|
it('should compute executable path for Chrome', () => {
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
@ -52,7 +54,6 @@ describe('launcher', () => {
|
|||||||
this.timeout(60000);
|
this.timeout(60000);
|
||||||
|
|
||||||
let tmpDir = '/tmp/puppeteer-browsers-test';
|
let tmpDir = '/tmp/puppeteer-browsers-test';
|
||||||
const testChromeBuildId = '1083080';
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
tmpDir = fs.mkdtempSync(
|
tmpDir = fs.mkdtempSync(
|
||||||
@ -91,7 +92,6 @@ describe('launcher', () => {
|
|||||||
this.timeout(60000);
|
this.timeout(60000);
|
||||||
|
|
||||||
let tmpDir = '/tmp/puppeteer-browsers-test';
|
let tmpDir = '/tmp/puppeteer-browsers-test';
|
||||||
const testFirefoxBuildId = '111.0a1';
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
tmpDir = fs.mkdtempSync(
|
tmpDir = fs.mkdtempSync(
|
||||||
|
20
packages/browsers/test/src/versions.ts
Normal file
20
packages/browsers/test/src/versions.ts
Normal file
@ -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';
|
Loading…
Reference in New Issue
Block a user