1. const semver = require('semver');
    
  2. const fs = require('fs');
    
  3. const ReactVersionSrc = fs.readFileSync(require.resolve('shared/ReactVersion'));
    
  4. const reactVersion = /export default '([^']+)';/.exec(ReactVersionSrc)[1];
    
  5. 
    
  6. const config = {
    
  7.   use: {
    
  8.     headless: true,
    
  9.     browserName: 'chromium',
    
  10.     launchOptions: {
    
  11.       // This bit of delay gives async React time to render
    
  12.       // and DevTools operations to be sent across the bridge.
    
  13.       slowMo: 100,
    
  14.     },
    
  15.     url: process.env.REACT_VERSION
    
  16.       ? 'http://localhost:8080/e2e-regression.html'
    
  17.       : 'http://localhost:8080/e2e.html',
    
  18.     react_version: process.env.REACT_VERSION
    
  19.       ? semver.coerce(process.env.REACT_VERSION).version
    
  20.       : reactVersion,
    
  21.     trace: 'retain-on-failure',
    
  22.   },
    
  23.   // Some of our e2e tests can be flaky. Retry tests to make sure the error isn't transient
    
  24.   retries: 3,
    
  25. };
    
  26. 
    
  27. module.exports = config;