react/packages/react-devtools-inline/playwright.config.js
Luna Ruan 254b49e589
Add snapshot testing on e2e test failure (#24672)
We have a currently unreproducible flaky e2e test. This PR captures snapshots on e2e test failures so we can better debug flaky e2e tests that don't fail locally.
2022-06-06 10:36:58 -07:00

28 lines
887 B
JavaScript

const semver = require('semver');
const fs = require('fs');
const ReactVersionSrc = fs.readFileSync(require.resolve('shared/ReactVersion'));
const reactVersion = /export default '([^']+)';/.exec(ReactVersionSrc)[1];
const config = {
use: {
headless: true,
browserName: 'chromium',
launchOptions: {
// This bit of delay gives async React time to render
// and DevTools operations to be sent across the bridge.
slowMo: 100,
},
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,
trace: 'retain-on-failure',
},
// Some of our e2e tests can be flaky. Retry tests to make sure the error isn't transient
retries: 3,
};
module.exports = config;