mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01:00
This PR: * Increases test retry count to 2 so that flaky tests have more of a chance to pass * Ideally most e2e tests will run for all React versions (and ensure DevTools elegantly fails if React doesn't support its features). However, some features aren't supported in older React versions at all (ex. Profiling) Add runOnlyForReactRange function in these cases to skip tests that don't satisfy the correct React semver range * Fix should allow searching for component by name test, which was flaky because sometimes the Searchbox would be unfocused the second time we try to type in it * Edited test Should allow elements to be inspected to check that element inspect gracefully fails in older React versions * Updated config to add a config.use.url field and a config.use.react_version field, which change depending on the React Version (and whether it's specified)
27 lines
855 B
JavaScript
27 lines
855 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,
|
|
},
|
|
// Some of our e2e tests can be flaky. Retry tests to make sure the error isn't transient
|
|
retries: 2,
|
|
};
|
|
|
|
module.exports = config;
|