From b032b629cb8f662b4c8cb7f84209b7855175dded Mon Sep 17 00:00:00 2001 From: jrandolf <101637635+jrandolf@users.noreply.github.com> Date: Tue, 18 Jul 2023 20:18:22 +0200 Subject: [PATCH] test: skip headful tests in headless modes (#10578) --- test/src/headful.spec.ts | 4 ++-- test/src/mocha-utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/src/headful.spec.ts b/test/src/headful.spec.ts index 69643f62..4049dc8a 100644 --- a/test/src/headful.spec.ts +++ b/test/src/headful.spec.ts @@ -22,7 +22,7 @@ import expect from 'expect'; import {PuppeteerLaunchOptions} from 'puppeteer-core/internal/node/PuppeteerNode.js'; import {rmSync} from 'puppeteer-core/internal/node/util/fs.js'; -import {getTestState, launch} from './mocha-utils.js'; +import {getTestState, isHeadless, launch} from './mocha-utils.js'; const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-'); @@ -35,7 +35,7 @@ const serviceWorkerExtensionPath = path.join( 'extension' ); -describe('headful tests', function () { +(!isHeadless ? describe : describe.skip)('headful tests', function () { /* These tests fire up an actual browser so let's * allow a higher timeout */ diff --git a/test/src/mocha-utils.ts b/test/src/mocha-utils.ts index 2fb68550..19a0aedb 100644 --- a/test/src/mocha-utils.ts +++ b/test/src/mocha-utils.ts @@ -49,7 +49,7 @@ const headless = (process.env['HEADLESS'] || 'true').trim().toLowerCase() as | 'true' | 'false' | 'new'; -const isHeadless = headless === 'true' || headless === 'new'; +export const isHeadless = headless === 'true' || headless === 'new'; const isFirefox = product === 'firefox'; const isChrome = product === 'chrome'; const protocol = (process.env['PUPPETEER_PROTOCOL'] || 'cdp') as