From ee18f0a14f4fa611b78fa3fc915226b9eabf28ec Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Fri, 3 Nov 2023 17:08:20 +0530 Subject: [PATCH] Add default puppeteer config from wp-scripts config to puppeteer config --- tests/e2e/puppeteer.config.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/e2e/puppeteer.config.js b/tests/e2e/puppeteer.config.js index c03291c6f1e..aa03aeb5492 100644 --- a/tests/e2e/puppeteer.config.js +++ b/tests/e2e/puppeteer.config.js @@ -3,18 +3,21 @@ */ const { executablePath } = require('puppeteer'); +/** + * WordPress dependencies + */ +const defaultPuppeteerConfig = require('@wordpress/scripts/config/puppeteer.config.js'); + // eslint-disable-next-line no-console, jest/require-hook -console.log(`Using Chromium from ${executablePath()}`); +console.log( + `${ + process.env.CI ? '::notice::' : '' + }Using Chromium from ${executablePath()}` +); module.exports = { launch: { - devtools: process.env.PUPPETEER_DEVTOOLS === 'true', - headless: process.env.PUPPETEER_HEADLESS !== 'false', - slowMo: parseInt(process.env.PUPPETEER_SLOWMO) || 0, - args: [ - '--enable-blink-features=ComputedAccessibilityInfo', - '--disable-web-security', - ], + ...defaultPuppeteerConfig.launch, executablePath: executablePath(), }, };