2020-04-02 13:41:06 +00:00
|
|
|
/** @format */
|
2020-07-28 19:23:32 +00:00
|
|
|
const { jestPuppeteerConfig } = require( '@automattic/puppeteer-utils' );
|
2020-04-02 13:41:06 +00:00
|
|
|
|
2020-05-04 17:37:25 +00:00
|
|
|
let puppeteerConfig;
|
|
|
|
|
|
|
|
if ( 'no' == global.process.env.node_config_dev ) {
|
2020-07-29 21:57:59 +00:00
|
|
|
puppeteerConfig = {
|
|
|
|
launch: {
|
|
|
|
// Required for the logged out and logged in tests so they don't share app state/token.
|
|
|
|
browserContext: 'incognito',
|
|
|
|
},
|
|
|
|
};
|
2020-05-04 17:37:25 +00:00
|
|
|
} else {
|
|
|
|
puppeteerConfig = {
|
|
|
|
launch: {
|
2020-07-28 19:23:32 +00:00
|
|
|
...jestPuppeteerConfig.launch,
|
2020-09-20 19:34:47 +00:00
|
|
|
slowMo: process.env.PUPPETEER_SLOWMO ? process.env.PUPPETEER_SLOWMO : 50,
|
|
|
|
headless: false,
|
2020-05-04 17:37:25 +00:00
|
|
|
ignoreHTTPSErrors: true,
|
|
|
|
args: [ '--window-size=1920,1080', '--user-agent=chrome' ],
|
|
|
|
devtools: true,
|
|
|
|
defaultViewport: {
|
|
|
|
width: 1280,
|
|
|
|
height: 800,
|
2020-07-29 21:57:59 +00:00
|
|
|
},
|
2020-05-04 17:37:25 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = puppeteerConfig;
|