cypress 15.2.0 → 15.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cypress +1 -1
- package/{lib → dist}/cli.js +219 -190
- package/{lib → dist}/cypress.js +29 -26
- package/{lib → dist}/errors.js +38 -26
- package/{lib → dist}/exec/open.js +14 -5
- package/{lib → dist}/exec/run.js +37 -26
- package/dist/exec/spawn.js +301 -0
- package/dist/exec/versions.js +67 -0
- package/{lib → dist}/exec/xvfb.js +47 -20
- package/{index.js → dist/index.js} +5 -5
- package/dist/index.mjs +9 -0
- package/{lib → dist}/tasks/cache.js +49 -52
- package/{lib → dist}/tasks/download.js +55 -64
- package/{lib → dist}/tasks/get-folder-size.js +4 -4
- package/{lib → dist}/tasks/install.js +41 -45
- package/{lib → dist}/tasks/state.js +55 -45
- package/dist/tasks/unzip.js +192 -0
- package/{lib → dist}/tasks/verify.js +121 -131
- package/{lib → dist}/util.js +38 -36
- package/package.json +10 -13
- package/types/cypress-automation.d.ts +2 -1
- package/types/cypress.d.ts +1 -0
- package/index.mjs +0 -17
- package/lib/exec/spawn.js +0 -285
- package/lib/exec/versions.js +0 -61
- package/lib/fs.js +0 -8
- package/lib/tasks/unzip.js +0 -198
- /package/{lib → dist}/VerboseRenderer.js +0 -0
- /package/{lib → dist}/exec/info.js +0 -0
- /package/{lib → dist}/exec/shared.js +0 -0
- /package/{lib → dist}/logger.js +0 -0
@@ -1,8 +1,18 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
13
|
};
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.needsSandbox = exports.start = exports.verifyTestRunnerTimeoutMs = void 0;
|
6
16
|
const lodash_1 = __importDefault(require("lodash"));
|
7
17
|
const chalk_1 = __importDefault(require("chalk"));
|
8
18
|
const listr2_1 = require("listr2");
|
@@ -19,60 +29,48 @@ const logger_1 = __importDefault(require("../logger"));
|
|
19
29
|
const xvfb_1 = __importDefault(require("../exec/xvfb"));
|
20
30
|
const state_1 = __importDefault(require("./state"));
|
21
31
|
const debug = (0, debug_1.default)('cypress:cli');
|
22
|
-
const
|
32
|
+
const verifyTestRunnerTimeoutMs = () => {
|
23
33
|
const verifyTimeout = +((util_1.default === null || util_1.default === void 0 ? void 0 : util_1.default.getEnv('CYPRESS_VERIFY_TIMEOUT')) || 'NaN');
|
24
34
|
if (lodash_1.default.isNumber(verifyTimeout) && !lodash_1.default.isNaN(verifyTimeout)) {
|
25
35
|
return verifyTimeout;
|
26
36
|
}
|
27
37
|
return 30000;
|
28
|
-
}
|
29
|
-
|
38
|
+
};
|
39
|
+
exports.verifyTestRunnerTimeoutMs = verifyTestRunnerTimeoutMs;
|
40
|
+
const checkExecutable = (binaryDir) => __awaiter(void 0, void 0, void 0, function* () {
|
30
41
|
const executable = state_1.default.getPathToExecutable(binaryDir);
|
31
42
|
debug('checking if executable exists', executable);
|
32
|
-
|
33
|
-
.
|
43
|
+
try {
|
44
|
+
const isExecutable = yield util_1.default.isExecutableAsync(executable);
|
34
45
|
debug('Binary is executable? :', isExecutable);
|
35
46
|
if (!isExecutable) {
|
36
47
|
return (0, errors_1.throwFormErrorText)(errors_1.errors.binaryNotExecutable(executable))();
|
37
48
|
}
|
38
|
-
}
|
39
|
-
|
40
|
-
if (
|
41
|
-
|
49
|
+
}
|
50
|
+
catch (err) {
|
51
|
+
if (err.code === 'ENOENT') {
|
52
|
+
if (util_1.default.isCi()) {
|
53
|
+
return (0, errors_1.throwFormErrorText)(errors_1.errors.notInstalledCI(executable))();
|
54
|
+
}
|
55
|
+
return (0, errors_1.throwFormErrorText)(errors_1.errors.missingApp(binaryDir))((0, common_tags_1.stripIndent) `
|
56
|
+
Cypress executable not found at: ${chalk_1.default.cyan(executable)}
|
57
|
+
`);
|
42
58
|
}
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
});
|
47
|
-
};
|
59
|
+
throw err;
|
60
|
+
}
|
61
|
+
});
|
48
62
|
const runSmokeTest = (binaryDir, options) => {
|
49
63
|
let executable = state_1.default.getPathToExecutable(binaryDir);
|
50
|
-
const onSmokeTestError = (smokeTestCommand, linuxWithDisplayEnv) => {
|
51
|
-
return (err) => {
|
52
|
-
debug('Smoke test failed:', err);
|
53
|
-
let errMessage = err.stderr || err.message;
|
54
|
-
debug('error message:', errMessage);
|
55
|
-
if (err.timedOut) {
|
56
|
-
debug('error timedOut is true');
|
57
|
-
return (0, errors_1.throwFormErrorText)(errors_1.errors.smokeTestFailure(smokeTestCommand, true))(errMessage);
|
58
|
-
}
|
59
|
-
if (linuxWithDisplayEnv && util_1.default.isBrokenGtkDisplay(errMessage)) {
|
60
|
-
util_1.default.logBrokenGtkDisplayWarning();
|
61
|
-
return (0, errors_1.throwFormErrorText)(errors_1.errors.invalidSmokeTestDisplayError)(errMessage);
|
62
|
-
}
|
63
|
-
return (0, errors_1.throwFormErrorText)(errors_1.errors.missingDependency)(errMessage);
|
64
|
-
};
|
65
|
-
};
|
66
64
|
const needsXvfb = xvfb_1.default.isNeeded();
|
67
65
|
debug('needs Xvfb?', needsXvfb);
|
68
66
|
/**
|
69
67
|
* Spawn Cypress running smoke test to check if all operating system
|
70
68
|
* dependencies are good.
|
71
69
|
*/
|
72
|
-
const spawn = (linuxWithDisplayEnv) => {
|
70
|
+
const spawn = (linuxWithDisplayEnv) => __awaiter(void 0, void 0, void 0, function* () {
|
73
71
|
const random = lodash_1.default.random(0, 1000);
|
74
72
|
const args = ['--smoke-test', `--ping=${random}`];
|
75
|
-
if (needsSandbox()) {
|
73
|
+
if ((0, exports.needsSandbox)()) {
|
76
74
|
// electron requires --no-sandbox to run as root
|
77
75
|
debug('disabling Electron sandbox');
|
78
76
|
args.unshift('--no-sandbox');
|
@@ -90,9 +88,8 @@ const runSmokeTest = (binaryDir, options) => {
|
|
90
88
|
env: Object.assign(Object.assign({}, process.env), { FORCE_COLOR: '0' }),
|
91
89
|
timeout: options.smokeTestTimeout,
|
92
90
|
});
|
93
|
-
|
94
|
-
.
|
95
|
-
.then((result) => {
|
91
|
+
try {
|
92
|
+
const result = yield util_1.default.exec(executable, args, stdioOptions);
|
96
93
|
// TODO: when execa > 1.1 is released
|
97
94
|
// change this to `result.all` for both stderr and stdout
|
98
95
|
// use lodash to be robust during tests against null result or missing stdout
|
@@ -104,23 +101,40 @@ const runSmokeTest = (binaryDir, options) => {
|
|
104
101
|
const errorText = smokeTestStderr || smokeTestStdout;
|
105
102
|
return (0, errors_1.throwFormErrorText)(errors_1.errors.smokeTestFailure(smokeTestCommand, false))(errorText);
|
106
103
|
}
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
.
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
104
|
+
}
|
105
|
+
catch (err) {
|
106
|
+
debug('Smoke test failed:', err);
|
107
|
+
let errMessage = err.stderr || err.message;
|
108
|
+
debug('error message:', errMessage);
|
109
|
+
if (err.timedOut) {
|
110
|
+
debug('error timedOut is true');
|
111
|
+
return (0, errors_1.throwFormErrorText)(errors_1.errors.smokeTestFailure(smokeTestCommand, true))(errMessage);
|
112
|
+
}
|
113
|
+
if (linuxWithDisplayEnv && util_1.default.isBrokenGtkDisplay(errMessage)) {
|
114
|
+
util_1.default.logBrokenGtkDisplayWarning();
|
115
|
+
return (0, errors_1.throwFormErrorText)(errors_1.errors.invalidSmokeTestDisplayError)(errMessage);
|
116
|
+
}
|
117
|
+
return (0, errors_1.throwFormErrorText)(errors_1.errors.missingDependency)(errMessage);
|
118
|
+
}
|
119
|
+
});
|
120
|
+
const spawnInXvfb = (linuxWithDisplayEnv) => __awaiter(void 0, void 0, void 0, function* () {
|
121
|
+
yield xvfb_1.default.start();
|
122
|
+
return spawn(linuxWithDisplayEnv || false).finally(() => __awaiter(void 0, void 0, void 0, function* () {
|
123
|
+
yield xvfb_1.default.stop();
|
124
|
+
}));
|
125
|
+
});
|
126
|
+
const userFriendlySpawn = (linuxWithDisplayEnv) => __awaiter(void 0, void 0, void 0, function* () {
|
118
127
|
debug('spawning, should retry on display problem?', Boolean(linuxWithDisplayEnv));
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
128
|
+
try {
|
129
|
+
yield spawn(linuxWithDisplayEnv);
|
130
|
+
}
|
131
|
+
catch (err) {
|
132
|
+
if (err.code === 'INVALID_SMOKE_TEST_DISPLAY_ERROR') {
|
133
|
+
return spawnInXvfb(linuxWithDisplayEnv);
|
134
|
+
}
|
135
|
+
throw err;
|
136
|
+
}
|
137
|
+
});
|
124
138
|
if (needsXvfb) {
|
125
139
|
return spawnInXvfb();
|
126
140
|
}
|
@@ -152,49 +166,39 @@ function testBinary(version, binaryDir, options) {
|
|
152
166
|
const tasks = new listr2_1.Listr([
|
153
167
|
{
|
154
168
|
title: util_1.default.titleize('Verifying Cypress can run', chalk_1.default.gray(binaryDir)),
|
155
|
-
task: (ctx, task) => {
|
169
|
+
task: (ctx, task) => __awaiter(this, void 0, void 0, function* () {
|
156
170
|
debug('clearing out the verified version');
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
return state_1.default.writeBinaryVerifiedAsync(true, binaryDir);
|
167
|
-
})
|
168
|
-
.then(() => {
|
169
|
-
util_1.default.setTaskTitle(task, util_1.default.titleize(chalk_1.default.green('Verified Cypress!'), chalk_1.default.gray(binaryDir)), rendererOptions.renderer);
|
170
|
-
});
|
171
|
-
},
|
171
|
+
yield state_1.default.clearBinaryStateAsync(binaryDir);
|
172
|
+
yield Promise.all([
|
173
|
+
runSmokeTest(binaryDir, options),
|
174
|
+
bluebird_1.default.delay(1500), // good user experience
|
175
|
+
]);
|
176
|
+
debug('write verified: true');
|
177
|
+
yield state_1.default.writeBinaryVerifiedAsync(true, binaryDir);
|
178
|
+
util_1.default.setTaskTitle(task, util_1.default.titleize(chalk_1.default.green('Verified Cypress!'), chalk_1.default.gray(binaryDir)), rendererOptions.renderer);
|
179
|
+
}),
|
172
180
|
},
|
173
181
|
], rendererOptions);
|
174
182
|
return tasks.run();
|
175
183
|
}
|
176
|
-
const maybeVerify = (installedVersion, binaryDir, options) => {
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
logger_1.default.log();
|
191
|
-
logger_1.default.log('Opening Cypress...');
|
192
|
-
}
|
193
|
-
});
|
184
|
+
const maybeVerify = (installedVersion, binaryDir, options) => __awaiter(void 0, void 0, void 0, function* () {
|
185
|
+
const isVerified = yield state_1.default.getBinaryVerifiedAsync(binaryDir);
|
186
|
+
debug('is Verified ?', isVerified);
|
187
|
+
let shouldVerify = !isVerified;
|
188
|
+
// force verify if options.force
|
189
|
+
if (options.force) {
|
190
|
+
debug('force verify');
|
191
|
+
shouldVerify = true;
|
192
|
+
}
|
193
|
+
if (shouldVerify) {
|
194
|
+
yield testBinary(installedVersion, binaryDir, options);
|
195
|
+
if (options.welcomeMessage) {
|
196
|
+
logger_1.default.log();
|
197
|
+
logger_1.default.log('Opening Cypress...');
|
194
198
|
}
|
195
|
-
}
|
196
|
-
};
|
197
|
-
const start = (options = {})
|
199
|
+
}
|
200
|
+
});
|
201
|
+
const start = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (options = {}) {
|
198
202
|
debug('verifying Cypress app');
|
199
203
|
const packageVersion = util_1.default.pkgVersion();
|
200
204
|
let binaryDir = state_1.default.getBinaryDir(packageVersion);
|
@@ -202,17 +206,17 @@ const start = (options = {}) => {
|
|
202
206
|
dev: false,
|
203
207
|
force: false,
|
204
208
|
welcomeMessage: true,
|
205
|
-
smokeTestTimeout:
|
209
|
+
smokeTestTimeout: (0, exports.verifyTestRunnerTimeoutMs)(),
|
206
210
|
skipVerify: util_1.default.getEnv('CYPRESS_SKIP_VERIFY') === 'true',
|
207
211
|
});
|
208
212
|
if (options.skipVerify) {
|
209
213
|
debug('skipping verification of the Cypress app');
|
210
|
-
return
|
214
|
+
return Promise.resolve();
|
211
215
|
}
|
212
216
|
if (options.dev) {
|
213
217
|
return runSmokeTest('', options);
|
214
218
|
}
|
215
|
-
const parseBinaryEnvVar = () => {
|
219
|
+
const parseBinaryEnvVar = () => __awaiter(void 0, void 0, void 0, function* () {
|
216
220
|
const envBinaryPath = util_1.default.getEnv('CYPRESS_RUN_BINARY');
|
217
221
|
debug('CYPRESS_RUN_BINARY exists, =', envBinaryPath);
|
218
222
|
logger_1.default.log((0, common_tags_1.stripIndent) `
|
@@ -223,48 +227,37 @@ const start = (options = {}) => {
|
|
223
227
|
This overrides the default Cypress binary path used.
|
224
228
|
`);
|
225
229
|
logger_1.default.log();
|
226
|
-
|
227
|
-
.
|
230
|
+
try {
|
231
|
+
const isExecutable = yield util_1.default.isExecutableAsync(envBinaryPath);
|
228
232
|
debug('CYPRESS_RUN_BINARY is executable? :', isExecutable);
|
229
233
|
if (!isExecutable) {
|
230
234
|
return (0, errors_1.throwFormErrorText)(errors_1.errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))((0, common_tags_1.stripIndent) `
|
231
|
-
|
232
|
-
|
235
|
+
The supplied binary path is not executable
|
236
|
+
`);
|
233
237
|
}
|
234
|
-
|
235
|
-
.then(() => {
|
236
|
-
return state_1.default.parseRealPlatformBinaryFolderAsync(envBinaryPath);
|
237
|
-
})
|
238
|
-
.then((envBinaryDir) => {
|
238
|
+
const envBinaryDir = yield state_1.default.parseRealPlatformBinaryFolderAsync(envBinaryPath);
|
239
239
|
if (!envBinaryDir) {
|
240
240
|
return (0, errors_1.throwFormErrorText)(errors_1.errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))();
|
241
241
|
}
|
242
242
|
debug('CYPRESS_RUN_BINARY has binaryDir:', envBinaryDir);
|
243
243
|
binaryDir = envBinaryDir;
|
244
|
-
}
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
244
|
+
}
|
245
|
+
catch (err) {
|
246
|
+
if (err.code === 'ENOENT') {
|
247
|
+
return (0, errors_1.throwFormErrorText)(errors_1.errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))(err.message);
|
248
|
+
}
|
249
|
+
throw err;
|
250
|
+
}
|
251
|
+
});
|
252
|
+
try {
|
250
253
|
debug('checking environment variables');
|
251
254
|
if (util_1.default.getEnv('CYPRESS_RUN_BINARY')) {
|
252
|
-
|
255
|
+
yield parseBinaryEnvVar();
|
253
256
|
}
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
.tap(() => {
|
259
|
-
return debug('binaryDir is ', binaryDir);
|
260
|
-
})
|
261
|
-
.then(() => {
|
262
|
-
return state_1.default.getBinaryPkgAsync(binaryDir);
|
263
|
-
})
|
264
|
-
.then((pkg) => {
|
265
|
-
return state_1.default.getBinaryPkgVersion(pkg);
|
266
|
-
})
|
267
|
-
.then((binaryVersion) => {
|
257
|
+
yield checkExecutable(binaryDir);
|
258
|
+
debug('binaryDir is ', binaryDir);
|
259
|
+
const pkg = yield state_1.default.getBinaryPkgAsync(binaryDir);
|
260
|
+
const binaryVersion = state_1.default.getBinaryPkgVersion(pkg);
|
268
261
|
if (!binaryVersion) {
|
269
262
|
debug('no Cypress binary found for cli version ', packageVersion);
|
270
263
|
return (0, errors_1.throwFormErrorText)(errors_1.errors.missingApp(binaryDir))(`
|
@@ -286,15 +279,16 @@ const start = (options = {}) => {
|
|
286
279
|
`);
|
287
280
|
logger_1.default.log();
|
288
281
|
}
|
289
|
-
|
290
|
-
}
|
291
|
-
|
282
|
+
yield maybeVerify(binaryVersion, binaryDir, options);
|
283
|
+
}
|
284
|
+
catch (err) {
|
292
285
|
if (err.known) {
|
293
286
|
throw err;
|
294
287
|
}
|
295
288
|
return (0, errors_1.throwFormErrorText)(errors_1.errors.unexpected)(err.stack);
|
296
|
-
}
|
297
|
-
};
|
289
|
+
}
|
290
|
+
});
|
291
|
+
exports.start = start;
|
298
292
|
const isLinuxLike = () => os_1.default.platform() !== 'win32';
|
299
293
|
/**
|
300
294
|
* Returns true if running on a system where Electron needs "--no-sandbox" flag.
|
@@ -306,8 +300,4 @@ const isLinuxLike = () => os_1.default.platform() !== 'win32';
|
|
306
300
|
* @see https://github.com/electron/electron/issues/17972
|
307
301
|
*/
|
308
302
|
const needsSandbox = () => isLinuxLike();
|
309
|
-
exports.
|
310
|
-
start,
|
311
|
-
needsSandbox,
|
312
|
-
VERIFY_TEST_RUNNER_TIMEOUT_MS,
|
313
|
-
};
|
303
|
+
exports.needsSandbox = needsSandbox;
|
package/{lib → dist}/util.js
RENAMED
@@ -13,12 +13,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const lodash_1 = __importDefault(require("lodash"));
|
16
|
+
const assert_1 = __importDefault(require("assert"));
|
16
17
|
const arch_1 = __importDefault(require("arch"));
|
17
18
|
const os_1 = __importDefault(require("os"));
|
18
19
|
const ospath_1 = __importDefault(require("ospath"));
|
19
20
|
const hasha_1 = __importDefault(require("hasha"));
|
20
|
-
const lazy_ass_1 = __importDefault(require("lazy-ass"));
|
21
|
-
const check_more_types_1 = __importDefault(require("check-more-types"));
|
22
21
|
const tty_1 = __importDefault(require("tty"));
|
23
22
|
const path_1 = __importDefault(require("path"));
|
24
23
|
const ci_info_1 = require("ci-info");
|
@@ -29,27 +28,28 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
29
28
|
const cachedir_1 = __importDefault(require("cachedir"));
|
30
29
|
const log_symbols_1 = __importDefault(require("log-symbols"));
|
31
30
|
const executable_1 = __importDefault(require("executable"));
|
31
|
+
const process_1 = require("process");
|
32
32
|
const common_tags_1 = require("common-tags");
|
33
33
|
const supports_color_1 = __importDefault(require("supports-color"));
|
34
34
|
const is_installed_globally_1 = __importDefault(require("is-installed-globally"));
|
35
35
|
const logger_1 = __importDefault(require("./logger"));
|
36
36
|
const debug_1 = __importDefault(require("debug"));
|
37
|
-
const
|
37
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
38
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
38
39
|
const debug = (0, debug_1.default)('cypress:cli');
|
39
|
-
// Import package.json dynamically to avoid TypeScript JSON import issues
|
40
|
-
const pkg = require(path_1.default.join(__dirname, '..', 'package.json'));
|
41
40
|
const issuesUrl = 'https://github.com/cypress-io/cypress/issues';
|
42
41
|
/**
|
43
42
|
* Returns SHA512 of a file
|
44
43
|
*/
|
45
44
|
const getFileChecksum = (filename) => {
|
46
|
-
(
|
45
|
+
assert_1.default.ok(lodash_1.default.isString(filename) && !lodash_1.default.isEmpty(filename), 'expected filename');
|
47
46
|
return hasha_1.default.fromFile(filename, { algorithm: 'sha512' });
|
48
47
|
};
|
49
|
-
const getFileSize = (filename) => {
|
50
|
-
(
|
51
|
-
|
52
|
-
|
48
|
+
const getFileSize = (filename) => __awaiter(void 0, void 0, void 0, function* () {
|
49
|
+
assert_1.default.ok(lodash_1.default.isString(filename) && !lodash_1.default.isEmpty(filename), 'expected filename');
|
50
|
+
const { size } = yield fs_extra_1.default.stat(filename);
|
51
|
+
return size;
|
52
|
+
});
|
53
53
|
const isBrokenGtkDisplayRe = /Gtk: cannot open display/;
|
54
54
|
const stringify = (val) => {
|
55
55
|
return lodash_1.default.isObject(val) ? JSON.stringify(val) : val;
|
@@ -152,8 +152,7 @@ function printNodeOptions(log = debug) {
|
|
152
152
|
```
|
153
153
|
*/
|
154
154
|
const dequote = (str) => {
|
155
|
-
|
156
|
-
(0, lazy_ass_1.default)(check_more_types_1.default.string(str), 'expected a string to remove double quotes', str);
|
155
|
+
assert_1.default.ok(lodash_1.default.isString(str), 'expected a string to remove double quotes');
|
157
156
|
if (str.length > 1 && str[0] === '"' && str[str.length - 1] === '"') {
|
158
157
|
return str.substr(1, str.length - 2);
|
159
158
|
}
|
@@ -184,7 +183,8 @@ const getApplicationDataFolder = (...paths) => {
|
|
184
183
|
const { env } = process;
|
185
184
|
// allow overriding the app_data folder
|
186
185
|
let folder = env.CYPRESS_CONFIG_ENV || env.CYPRESS_INTERNAL_ENV || 'development';
|
187
|
-
|
186
|
+
// @ts-expect-error value exists but is not typed
|
187
|
+
const PRODUCT_NAME = package_json_1.default.productName || package_json_1.default.name;
|
188
188
|
const OS_DATA_PATH = ospath_1.default.data();
|
189
189
|
const ELECTRON_APP_DATA_PATH = path_1.default.join(OS_DATA_PATH, PRODUCT_NAME);
|
190
190
|
if (process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF) {
|
@@ -205,13 +205,13 @@ const util = {
|
|
205
205
|
getEnvOverrides(options = {}) {
|
206
206
|
return lodash_1.default
|
207
207
|
.chain({})
|
208
|
-
.extend(
|
209
|
-
.extend(
|
208
|
+
.extend(this.getEnvColors())
|
209
|
+
.extend(this.getForceTty())
|
210
210
|
.omitBy(lodash_1.default.isUndefined) // remove undefined values
|
211
211
|
.mapValues((value) => {
|
212
212
|
return value ? '1' : '0';
|
213
213
|
})
|
214
|
-
.extend(
|
214
|
+
.extend(this.getOriginalNodeOptions())
|
215
215
|
.value();
|
216
216
|
},
|
217
217
|
getOriginalNodeOptions() {
|
@@ -223,13 +223,13 @@ const util = {
|
|
223
223
|
},
|
224
224
|
getForceTty() {
|
225
225
|
return {
|
226
|
-
FORCE_STDIN_TTY:
|
227
|
-
FORCE_STDOUT_TTY:
|
228
|
-
FORCE_STDERR_TTY:
|
226
|
+
FORCE_STDIN_TTY: this.isTty(process.stdin.fd),
|
227
|
+
FORCE_STDOUT_TTY: this.isTty(process.stdout.fd),
|
228
|
+
FORCE_STDERR_TTY: this.isTty(process.stderr.fd),
|
229
229
|
};
|
230
230
|
},
|
231
231
|
getEnvColors() {
|
232
|
-
const sc =
|
232
|
+
const sc = this.supportsColor();
|
233
233
|
return {
|
234
234
|
FORCE_COLOR: sc,
|
235
235
|
DEBUG_COLORS: sc,
|
@@ -254,14 +254,16 @@ const util = {
|
|
254
254
|
return Boolean(supports_color_1.default.stdout) && Boolean(supports_color_1.default.stderr);
|
255
255
|
},
|
256
256
|
cwd() {
|
257
|
-
return
|
257
|
+
return (0, process_1.cwd)();
|
258
258
|
},
|
259
259
|
pkgBuildInfo() {
|
260
|
-
|
260
|
+
// @ts-expect-error value exists but is not typed
|
261
|
+
return package_json_1.default.buildInfo;
|
261
262
|
},
|
262
263
|
pkgVersion() {
|
263
|
-
return
|
264
|
+
return package_json_1.default.version;
|
264
265
|
},
|
266
|
+
// TODO: remove this method
|
265
267
|
exit(code) {
|
266
268
|
process.exit(code);
|
267
269
|
},
|
@@ -316,27 +318,28 @@ const util = {
|
|
316
318
|
},
|
317
319
|
isLinux,
|
318
320
|
getOsVersionAsync() {
|
319
|
-
return
|
320
|
-
|
321
|
-
.
|
321
|
+
return __awaiter(this, void 0, void 0, function* () {
|
322
|
+
try {
|
323
|
+
const osInfo = yield systeminformation_1.default.osInfo();
|
322
324
|
if (osInfo.distro && osInfo.release) {
|
323
325
|
return `${osInfo.distro} - ${osInfo.release}`;
|
324
326
|
}
|
327
|
+
}
|
328
|
+
catch (err) {
|
325
329
|
return os_1.default.release();
|
326
|
-
}
|
327
|
-
|
328
|
-
});
|
330
|
+
}
|
331
|
+
return os_1.default.release();
|
329
332
|
});
|
330
333
|
},
|
331
334
|
getPlatformInfo() {
|
332
335
|
return __awaiter(this, void 0, void 0, function* () {
|
333
336
|
const [version, osArch] = yield bluebird_1.default.all([
|
334
|
-
|
337
|
+
this.getOsVersionAsync(),
|
335
338
|
this.getRealArch(),
|
336
339
|
]);
|
337
340
|
return (0, common_tags_1.stripIndent) `
|
338
341
|
Platform: ${os_1.default.platform()}-${osArch} (${version})
|
339
|
-
Cypress Version: ${
|
342
|
+
Cypress Version: ${this.pkgVersion()}
|
340
343
|
`;
|
341
344
|
});
|
342
345
|
},
|
@@ -390,10 +393,10 @@ const util = {
|
|
390
393
|
if (path_1.default.isAbsolute(filename)) {
|
391
394
|
return filename;
|
392
395
|
}
|
393
|
-
return path_1.default.join(
|
396
|
+
return path_1.default.join((0, process_1.cwd)(), '..', '..', filename);
|
394
397
|
},
|
395
398
|
getEnv(varName, trim) {
|
396
|
-
(
|
399
|
+
assert_1.default.ok(lodash_1.default.isString(varName) && !lodash_1.default.isEmpty(varName), 'expected environment variable name, not');
|
397
400
|
const configVarName = `npm_config_${varName}`;
|
398
401
|
const configVarNameLower = configVarName.toLowerCase();
|
399
402
|
const packageConfigVarName = `npm_package_config_${varName}`;
|
@@ -438,9 +441,8 @@ const util = {
|
|
438
441
|
logBrokenGtkDisplayWarning,
|
439
442
|
isPossibleLinuxWithIncorrectDisplay,
|
440
443
|
getGitHubIssueUrl(number) {
|
441
|
-
|
442
|
-
|
443
|
-
(0, lazy_ass_1.default)(lodash_1.default.isInteger(number), 'github issue should be an integer', number);
|
444
|
+
assert_1.default.ok(lodash_1.default.isInteger(number), 'github issue should be an integer');
|
445
|
+
assert_1.default.ok(number > 0, 'github issue should be a positive number');
|
444
446
|
return `${issuesUrl}/${number}`;
|
445
447
|
},
|
446
448
|
getFileChecksum,
|
package/package.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "cypress",
|
3
|
-
"version": "15.
|
4
|
-
"main": "index.js",
|
3
|
+
"version": "15.3.0",
|
4
|
+
"main": "dist/index.js",
|
5
5
|
"scripts": {
|
6
|
-
"postinstall": "node index.js --exec install",
|
6
|
+
"postinstall": "node dist/index.js --exec install",
|
7
7
|
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
@@ -11,13 +11,13 @@
|
|
11
11
|
"@cypress/xvfb": "^1.2.4",
|
12
12
|
"@types/sinonjs__fake-timers": "8.1.1",
|
13
13
|
"@types/sizzle": "^2.3.2",
|
14
|
+
"@types/tmp": "^0.2.3",
|
14
15
|
"arch": "^2.2.0",
|
15
16
|
"blob-util": "^2.0.2",
|
16
17
|
"bluebird": "^3.7.2",
|
17
18
|
"buffer": "^5.7.1",
|
18
19
|
"cachedir": "^2.3.0",
|
19
20
|
"chalk": "^4.1.0",
|
20
|
-
"check-more-types": "^2.24.0",
|
21
21
|
"ci-info": "^4.1.0",
|
22
22
|
"cli-cursor": "^3.1.0",
|
23
23
|
"cli-table3": "0.6.1",
|
@@ -34,7 +34,6 @@
|
|
34
34
|
"fs-extra": "^9.1.0",
|
35
35
|
"hasha": "5.2.2",
|
36
36
|
"is-installed-globally": "~0.4.0",
|
37
|
-
"lazy-ass": "^1.6.0",
|
38
37
|
"listr2": "^3.8.3",
|
39
38
|
"lodash": "^4.17.21",
|
40
39
|
"log-symbols": "^4.0.0",
|
@@ -54,9 +53,7 @@
|
|
54
53
|
},
|
55
54
|
"files": [
|
56
55
|
"bin",
|
57
|
-
"
|
58
|
-
"index.js",
|
59
|
-
"index.mjs",
|
56
|
+
"dist",
|
60
57
|
"types/**/*.d.ts",
|
61
58
|
"mount-utils",
|
62
59
|
"vue",
|
@@ -68,14 +65,14 @@
|
|
68
65
|
"cypress": "bin/cypress"
|
69
66
|
},
|
70
67
|
"engines": {
|
71
|
-
"node": "^20.
|
68
|
+
"node": "^20.1.0 || ^22.0.0 || >=24.0.0"
|
72
69
|
},
|
73
70
|
"types": "types",
|
74
71
|
"exports": {
|
75
72
|
".": {
|
76
73
|
"types": "./types/index.d.ts",
|
77
|
-
"import": "./index.mjs",
|
78
|
-
"require": "./index.js"
|
74
|
+
"import": "./dist/index.mjs",
|
75
|
+
"require": "./dist/index.js"
|
79
76
|
},
|
80
77
|
"./types/net-stubbing": {
|
81
78
|
"types": "./types/net-stubbing.d.ts"
|
@@ -127,8 +124,8 @@
|
|
127
124
|
},
|
128
125
|
"buildInfo": {
|
129
126
|
"commitBranch": "develop",
|
130
|
-
"commitSha": "
|
131
|
-
"commitDate": "2025-09-
|
127
|
+
"commitSha": "556243acd780b95ad2ff7a1635fdd5cec56a97b6",
|
128
|
+
"commitDate": "2025-09-23T16:51:17.000Z",
|
132
129
|
"stable": true
|
133
130
|
},
|
134
131
|
"description": "Cypress is a next generation front end testing tool built for the modern web",
|