browserstack-cypress-cli 1.36.5 → 1.36.7
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/.claude/settings.local.json +13 -0
- package/.nyc_output/1480c3f2-b8f1-4f4a-a59a-83e6ca5904dd.json +1 -0
- package/.nyc_output/771e6012-aa7b-4bb8-b680-2fca6a6eafd2.json +1 -0
- package/.nyc_output/b968a0a5-c10d-40a3-945a-14d600e51f48.json +1 -0
- package/.nyc_output/processinfo/1480c3f2-b8f1-4f4a-a59a-83e6ca5904dd.json +1 -0
- package/.nyc_output/processinfo/771e6012-aa7b-4bb8-b680-2fca6a6eafd2.json +1 -0
- package/.nyc_output/processinfo/b968a0a5-c10d-40a3-945a-14d600e51f48.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/bin/helpers/readCypressConfigUtil.js +42 -6
- package/bin/testObservability/cypress/index.js +9 -3
- package/bin/testObservability/reporter/index.js +3 -1
- package/package.json +4 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"parent":"b968a0a5-c10d-40a3-945a-14d600e51f48","pid":53774,"argv":["/Users/karan/.nvm/versions/node/v14.21.3/bin/node","/Users/karan/.nvm/versions/node/v14.21.3/bin/npm","root","-g"],"execArgv":[],"cwd":"/Users/karan/temp/temp/browserstack-cypress-cli","time":1778847840627,"ppid":53762,"coverageFilename":"/Users/karan/temp/temp/browserstack-cypress-cli/.nyc_output/1480c3f2-b8f1-4f4a-a59a-83e6ca5904dd.json","externalId":"","uuid":"1480c3f2-b8f1-4f4a-a59a-83e6ca5904dd","files":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"parent":null,"pid":53746,"argv":["/Users/karan/.nvm/versions/node/v14.21.3/bin/node","/Users/karan/temp/temp/browserstack-cypress-cli/node_modules/.bin/nyc","mocha","test/**/*.js","--recursive","--timeout","60000","--exit"],"execArgv":[],"cwd":"/Users/karan/temp/temp/browserstack-cypress-cli","time":1778847835552,"ppid":53740,"coverageFilename":"/Users/karan/temp/temp/browserstack-cypress-cli/.nyc_output/771e6012-aa7b-4bb8-b680-2fca6a6eafd2.json","externalId":"","uuid":"771e6012-aa7b-4bb8-b680-2fca6a6eafd2","files":["/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/constants.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/cypress/index.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/helper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/plugin/index.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/generateDownloads.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/generateReport.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/info.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/init.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/runs.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/stop.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/archiver.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/atsHelper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/build.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/buildArtifacts.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/capabilityHelper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/checkUploaded.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/config.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/constants.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/downloadBuildStacktrace.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/fileHelpers.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/getInitialDetails.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/hashUtil.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/helper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/logger.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/package-diff.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/packageInstaller.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/readCypressConfigUtil.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/reporterHTML.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/requireModule.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/runnerArgs.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/sync/failedSpecsDetails.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/sync/specsSummary.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/sync/syncSpecsLogs.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/syncRunner.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/timeComponents.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/usageReporting.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/utils.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/zipUpload.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/runner.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/templates/configTemplate.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/constants.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/testhubHandler.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/utils.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/crashReporter/index.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/cypress/index.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/cleanupQueueSync.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/constants.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/helper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/requestQueueHandler.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/plugin/index.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/plugin/ipcClient.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/plugin/ipcServer.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/reporter/index.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"parent":null,"pid":53762,"argv":["/Users/karan/.nvm/versions/node/v14.21.3/bin/node","/Users/karan/temp/temp/browserstack-cypress-cli/node_modules/.bin/mocha","test/**/*.js","--recursive","--timeout","60000","--exit"],"execArgv":[],"cwd":"/Users/karan/temp/temp/browserstack-cypress-cli","time":1778847838876,"ppid":53746,"coverageFilename":"/Users/karan/temp/temp/browserstack-cypress-cli/.nyc_output/b968a0a5-c10d-40a3-945a-14d600e51f48.json","externalId":"","uuid":"b968a0a5-c10d-40a3-945a-14d600e51f48","files":["/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/buildArtifacts.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/logger.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/utils.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/helper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/readCypressConfigUtil.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/config.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/constants.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/crashReporter/index.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/constants.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/usageReporting.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/atsHelper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/fileHelpers.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/helper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/runnerArgs.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/utils.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/constants.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/helper.js","/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/constants.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"processes":{"1480c3f2-b8f1-4f4a-a59a-83e6ca5904dd":{"parent":"b968a0a5-c10d-40a3-945a-14d600e51f48","children":[]},"771e6012-aa7b-4bb8-b680-2fca6a6eafd2":{"parent":null,"children":[]},"b968a0a5-c10d-40a3-945a-14d600e51f48":{"parent":null,"children":["1480c3f2-b8f1-4f4a-a59a-83e6ca5904dd"]}},"files":{"/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/constants.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/cypress/index.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/helper.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/accessibility-automation/plugin/index.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/generateDownloads.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/generateReport.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/info.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/init.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/runs.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/commands/stop.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/archiver.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/atsHelper.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/build.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/buildArtifacts.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/capabilityHelper.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/checkUploaded.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/config.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/constants.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/downloadBuildStacktrace.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/fileHelpers.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/getInitialDetails.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/hashUtil.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/helper.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/logger.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/package-diff.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/packageInstaller.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/readCypressConfigUtil.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/reporterHTML.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/requireModule.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/runnerArgs.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/sync/failedSpecsDetails.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/sync/specsSummary.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/sync/syncSpecsLogs.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/syncRunner.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/timeComponents.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/usageReporting.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/utils.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/helpers/zipUpload.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/runner.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/templates/configTemplate.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/constants.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/testhubHandler.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testhub/utils.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/crashReporter/index.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/cypress/index.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/cleanupQueueSync.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/constants.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/helper.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2","b968a0a5-c10d-40a3-945a-14d600e51f48"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/helper/requestQueueHandler.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/plugin/index.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/plugin/ipcClient.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/plugin/ipcServer.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"],"/Users/karan/temp/temp/browserstack-cypress-cli/bin/testObservability/reporter/index.js":["771e6012-aa7b-4bb8-b680-2fca6a6eafd2"]},"externalIds":{}}
|
|
@@ -8,6 +8,26 @@ const constants = require("./constants");
|
|
|
8
8
|
const utils = require("./utils");
|
|
9
9
|
const logger = require('./logger').winstonLogger;
|
|
10
10
|
|
|
11
|
+
// Defense-in-depth: reject file paths containing shell metacharacters.
|
|
12
|
+
// This guards against command injection even if execFileSync is ever
|
|
13
|
+
// replaced with a shell-based exec in the future.
|
|
14
|
+
//
|
|
15
|
+
// Note: backslash (\) is intentionally NOT included here because it is a
|
|
16
|
+
// legitimate path separator on Windows (e.g. C:\Users\me\cypress.config.js).
|
|
17
|
+
// The actual security boundary is execFileSync (no shell), not this regex.
|
|
18
|
+
const DANGEROUS_PATH_CHARS = /[;"`$|&(){}]/;
|
|
19
|
+
|
|
20
|
+
function validateFilePath(filepath) {
|
|
21
|
+
if (DANGEROUS_PATH_CHARS.test(filepath)) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
`Invalid cypress config file path: "${filepath}" contains disallowed characters. ` +
|
|
24
|
+
'File paths must not include shell metacharacters such as ; " ` $ | & ( ) { }'
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.validateFilePath = validateFilePath;
|
|
30
|
+
|
|
11
31
|
exports.detectLanguage = (cypress_config_filename) => {
|
|
12
32
|
const extension = cypress_config_filename.split('.').pop()
|
|
13
33
|
return constants.CYPRESS_V10_AND_ABOVE_CONFIG_FILE_EXTENSIONS.includes(extension) ? extension : 'js'
|
|
@@ -186,13 +206,29 @@ exports.convertTsConfig = (bsConfig, cypress_config_filepath, bstack_node_module
|
|
|
186
206
|
}
|
|
187
207
|
|
|
188
208
|
exports.loadJsFile = (cypress_config_filepath, bstack_node_modules_path) => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
209
|
+
// Security: validate file path to reject shell metacharacters (defense-in-depth)
|
|
210
|
+
validateFilePath(cypress_config_filepath);
|
|
211
|
+
|
|
212
|
+
// UX: surface a clear error if the cypress config file is missing.
|
|
213
|
+
// (This is purely a UX check — the security boundary is execFileSync above
|
|
214
|
+
// plus the metacharacter regex; existsSync alone would NOT prevent injection.)
|
|
215
|
+
if (!fs.existsSync(cypress_config_filepath)) {
|
|
216
|
+
throw new Error(`Cypress config file not found at: ${cypress_config_filepath}`);
|
|
193
217
|
}
|
|
194
|
-
|
|
195
|
-
|
|
218
|
+
|
|
219
|
+
const require_module_helper_path = path.join(__dirname, 'requireModule.js')
|
|
220
|
+
|
|
221
|
+
// Security fix: use execFileSync instead of execSync to avoid shell interpolation.
|
|
222
|
+
// execFileSync spawns the process directly without a shell, so user-controlled
|
|
223
|
+
// values in cypress_config_filepath cannot break out into shell commands.
|
|
224
|
+
const execOptions = {
|
|
225
|
+
env: Object.assign({}, process.env, { NODE_PATH: bstack_node_modules_path })
|
|
226
|
+
};
|
|
227
|
+
const args = [require_module_helper_path, cypress_config_filepath];
|
|
228
|
+
|
|
229
|
+
logger.debug(`Running: node ${args.map(a => '"' + a + '"').join(' ')} (via execFileSync, NODE_PATH=${bstack_node_modules_path})`);
|
|
230
|
+
cp.execFileSync('node', args, execOptions);
|
|
231
|
+
|
|
196
232
|
const cypress_config = JSON.parse(fs.readFileSync(config.configJsonFileName).toString())
|
|
197
233
|
if (fs.existsSync(config.configJsonFileName)) {
|
|
198
234
|
fs.unlinkSync(config.configJsonFileName)
|
|
@@ -201,24 +201,30 @@ Cypress.on('command:end', (command) => {
|
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
203
|
|
|
204
|
-
Cypress.
|
|
204
|
+
Cypress.on('command:enqueued', (attrs) => {
|
|
205
|
+
if (!Cypress.env('BROWSERSTACK_O11Y_LOGS')) return;
|
|
206
|
+
if (!attrs || attrs.name !== 'log') return;
|
|
207
|
+
const args = attrs.args || [];
|
|
205
208
|
if (args.includes('test_observability_log') || args.includes('test_observability_command')) return;
|
|
206
209
|
const message = args.reduce((result, logItem) => {
|
|
207
210
|
if (typeof logItem === 'object') {
|
|
208
211
|
return [result, JSON.stringify(logItem)].join(' ');
|
|
209
212
|
}
|
|
210
|
-
|
|
211
213
|
return [result, logItem ? logItem.toString() : ''].join(' ');
|
|
212
214
|
}, '');
|
|
213
215
|
eventsQueue.push({
|
|
214
216
|
task: 'test_observability_log',
|
|
215
217
|
data: {
|
|
216
|
-
|
|
218
|
+
level: 'info',
|
|
217
219
|
message,
|
|
218
220
|
timestamp: new Date().toISOString()
|
|
219
221
|
},
|
|
220
222
|
options: { log: false }
|
|
221
223
|
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
Cypress.Commands.overwrite('log', (originalFn, ...args) => {
|
|
227
|
+
if (args.includes('test_observability_log') || args.includes('test_observability_command')) return;
|
|
222
228
|
originalFn(...args);
|
|
223
229
|
});
|
|
224
230
|
|
|
@@ -631,7 +631,9 @@ class MyReporter {
|
|
|
631
631
|
if(this.current_hook && ( this.current_hook.hookAnalyticsId && !this.runStatusMarkedHash[this.current_hook.hookAnalyticsId] )) {
|
|
632
632
|
log.hook_run_uuid = this.current_hook.hookAnalyticsId;
|
|
633
633
|
}
|
|
634
|
-
if(!log.hook_run_uuid && this.current_test &&
|
|
634
|
+
if(!log.hook_run_uuid && this.current_test && this.current_test.testAnalyticsId) {
|
|
635
|
+
log.test_run_uuid = this.current_test.testAnalyticsId;
|
|
636
|
+
}
|
|
635
637
|
if(log.hook_run_uuid || log.test_run_uuid) {
|
|
636
638
|
await uploadEventData({
|
|
637
639
|
event_type: 'LogCreated',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browserstack-cypress-cli",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.7",
|
|
4
4
|
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
"bugs": {
|
|
50
50
|
"url": "https://github.com/browserstack/browserstack-cypress-cli/issues"
|
|
51
51
|
},
|
|
52
|
+
"overrides": {
|
|
53
|
+
"serialize-javascript": ">=7.0.5"
|
|
54
|
+
},
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
"chai": "4.3.6",
|
|
54
57
|
"chai-as-promised": "7.1.1",
|