test: skip headful tests in headless modes (#10578)

This commit is contained in:
jrandolf 2023-07-18 20:18:22 +02:00 committed by GitHub
parent b03d7bb9f8
commit b032b629cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ import expect from 'expect';
import {PuppeteerLaunchOptions} from 'puppeteer-core/internal/node/PuppeteerNode.js'; import {PuppeteerLaunchOptions} from 'puppeteer-core/internal/node/PuppeteerNode.js';
import {rmSync} from 'puppeteer-core/internal/node/util/fs.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-'); const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
@ -35,7 +35,7 @@ const serviceWorkerExtensionPath = path.join(
'extension' 'extension'
); );
describe('headful tests', function () { (!isHeadless ? describe : describe.skip)('headful tests', function () {
/* These tests fire up an actual browser so let's /* These tests fire up an actual browser so let's
* allow a higher timeout * allow a higher timeout
*/ */

View File

@ -49,7 +49,7 @@ const headless = (process.env['HEADLESS'] || 'true').trim().toLowerCase() as
| 'true' | 'true'
| 'false' | 'false'
| 'new'; | 'new';
const isHeadless = headless === 'true' || headless === 'new'; export const isHeadless = headless === 'true' || headless === 'new';
const isFirefox = product === 'firefox'; const isFirefox = product === 'firefox';
const isChrome = product === 'chrome'; const isChrome = product === 'chrome';
const protocol = (process.env['PUPPETEER_PROTOCOL'] || 'cdp') as const protocol = (process.env['PUPPETEER_PROTOCOL'] || 'cdp') as