Skip to content

Commit

Permalink
Add default puppeteer config from wp-scripts config to puppeteer config
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Nov 3, 2023
1 parent 36246a6 commit ee18f0a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/e2e/puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
};

0 comments on commit ee18f0a

Please sign in to comment.