Skip to content

Commit 88dc811

Browse files
committed
modified run_devtools_e2e_tests scrtip
1 parent f534cc6 commit 88dc811

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"mkdirp": "^0.5.1",
7979
"ncp": "^2.0.0",
8080
"pacote": "^10.3.0",
81+
"@playwright/test": "^1.16.3",
8182
"prettier": "1.19.1",
8283
"prop-types": "^15.6.2",
8384
"random-seed": "^0.3.0",

scripts/circleci/run_devtools_e2e_tests.js

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const {spawn} = require('child_process');
66
const {join} = require('path');
77

88
const ROOT_PATH = join(__dirname, '..', '..');
9-
9+
const reactVersion = process.argv[2];
1010
const inlinePackagePath = join(ROOT_PATH, 'packages', 'react-devtools-inline');
1111
const shellPackagePath = join(ROOT_PATH, 'packages', 'react-devtools-shell');
1212

@@ -74,7 +74,24 @@ function runTestShell() {
7474

7575
logBright('Starting testing shell server');
7676

77-
serverProcess = spawn('yarn', ['start'], {cwd: shellPackagePath});
77+
if (!reactVersion) {
78+
serverProcess = spawn('yarn', ['start'], {cwd: shellPackagePath});
79+
} else {
80+
serverProcess = spawn(
81+
'yarn',
82+
[
83+
'cross-env',
84+
`REACT_VERSION=${reactVersion}`,
85+
'cross-env',
86+
'NODE_ENV=development',
87+
'cross-env',
88+
'TARGET=local',
89+
'webpack-dev-server',
90+
],
91+
{cwd: shellPackagePath}
92+
);
93+
}
94+
7895
serverProcess.stdout.on('data', data => {
7996
if (`${data}`.includes('Compiled successfully.')) {
8097
logBright('Testing shell server running');
@@ -107,7 +124,23 @@ function runTestShell() {
107124
async function runEndToEndTests() {
108125
logBright('Running e2e tests');
109126

110-
testProcess = spawn('yarn', ['test:e2e'], {cwd: inlinePackagePath});
127+
if (!reactVersion) {
128+
testProcess = spawn(
129+
'yarn',
130+
['playwright test --config=playwright.config.js'],
131+
{cwd: inlinePackagePath}
132+
);
133+
} else {
134+
testProcess = spawn(
135+
'yarn',
136+
[
137+
'cross-env',
138+
`REACT_VERSION=${reactVersion}`,
139+
'playwright test --config=playwright.config.js',
140+
],
141+
{cwd: inlinePackagePath}
142+
);
143+
}
111144
testProcess.stdout.on('data', data => {
112145
// Log without formatting because Playwright applies its own formatting.
113146
const formatted = format(data);

0 commit comments

Comments
 (0)