mirror of
https://github.com/facebook/react.git
synced 2026-02-23 20:23:02 +00: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)
18 lines
450 B
JavaScript
18 lines
450 B
JavaScript
'use strict';
|
|
|
|
/** @flow */
|
|
|
|
const semver = require('semver');
|
|
const config = require('../../playwright.config');
|
|
const {test} = require('@playwright/test');
|
|
|
|
function runOnlyForReactRange(range) {
|
|
test.skip(
|
|
!semver.satisfies(config.use.react_version, range),
|
|
`This test requires a React version of ${range} to run. ` +
|
|
`The React version you're using is ${config.use.react_version}`
|
|
);
|
|
}
|
|
|
|
module.exports = {runOnlyForReactRange};
|