2022-05-25 17:53:44 -07:00
|
|
|
const semver = require('semver');
|
|
|
|
|
const fs = require('fs');
|
|
|
|
|
const ReactVersionSrc = fs.readFileSync(require.resolve('shared/ReactVersion'));
|
|
|
|
|
const reactVersion = /export default '([^']+)';/.exec(ReactVersionSrc)[1];
|
|
|
|
|
|
2021-11-16 03:14:45 +05:30
|
|
|
const config = {
|
|
|
|
|
use: {
|
2021-12-21 11:58:04 -05:00
|
|
|
headless: true,
|
2021-11-16 03:14:45 +05:30
|
|
|
browserName: 'chromium',
|
|
|
|
|
launchOptions: {
|
2021-12-21 11:58:04 -05:00
|
|
|
// This bit of delay gives async React time to render
|
|
|
|
|
// and DevTools operations to be sent across the bridge.
|
2021-11-16 03:14:45 +05:30
|
|
|
slowMo: 100,
|
|
|
|
|
},
|
2022-05-25 17:53:44 -07:00
|
|
|
url: process.env.REACT_VERSION
|
|
|
|
|
? 'http://localhost:8080/e2e-regression.html'
|
|
|
|
|
: 'http://localhost:8080/e2e.html',
|
|
|
|
|
react_version: process.env.REACT_VERSION
|
|
|
|
|
? semver.coerce(process.env.REACT_VERSION).version
|
|
|
|
|
: reactVersion,
|
2022-06-06 10:36:58 -07:00
|
|
|
trace: 'retain-on-failure',
|
2021-11-16 03:14:45 +05:30
|
|
|
},
|
2022-05-25 17:53:44 -07:00
|
|
|
// Some of our e2e tests can be flaky. Retry tests to make sure the error isn't transient
|
2022-06-06 10:36:58 -07:00
|
|
|
retries: 3,
|
2021-11-16 03:14:45 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = config;
|