browserstack-cypress-cli 1.25.0 → 1.25.2
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/helpers/utils.js
CHANGED
|
@@ -942,6 +942,12 @@ exports.setLocalArgs = (bsConfig, args) => {
|
|
|
942
942
|
let local_args = {}
|
|
943
943
|
local_args['key'] = bsConfig['auth']['access_key'];
|
|
944
944
|
local_args['localIdentifier'] = bsConfig["connection_settings"]["local_identifier"];
|
|
945
|
+
if (bsConfig["connection_settings"]["proxyHost"])
|
|
946
|
+
local_args['proxyHost'] = bsConfig["connection_settings"]["proxyHost"];
|
|
947
|
+
if (bsConfig["connection_settings"]["proxyPort"])
|
|
948
|
+
local_args['proxyPort'] = bsConfig["connection_settings"]["proxyPort"];
|
|
949
|
+
if (bsConfig["connection_settings"]["useCaCertificate"])
|
|
950
|
+
local_args['useCaCertificate'] = bsConfig["connection_settings"]["useCaCertificate"];
|
|
945
951
|
local_args['daemon'] = true;
|
|
946
952
|
local_args['enable-logging-for-api'] = true
|
|
947
953
|
local_args['source'] = `cypress:${usageReporting.cli_version_and_path(bsConfig).version}`;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
/* Used to detect Gherkin steps */
|
|
4
4
|
Cypress.on('log:added', (log) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
return () => {
|
|
6
|
+
return cy.now('task', 'test_observability_step', {
|
|
7
|
+
log
|
|
8
|
+
}, {log: false})
|
|
9
|
+
}
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
Cypress.on('command:start', (command) => {
|
|
@@ -163,16 +163,11 @@ exports.getTestEnv = () => {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
exports.getFileSeparatorData = () => {
|
|
166
|
-
|
|
167
|
-
const fileSeparator = /^win/.test(process.platform) ? "\\" : "/";
|
|
168
|
-
return {
|
|
169
|
-
fileSeparator,
|
|
170
|
-
fileSeparatorRegex
|
|
171
|
-
};
|
|
166
|
+
return /^win/.test(process.platform) ? "\\" : "/";
|
|
172
167
|
}
|
|
173
168
|
|
|
174
169
|
exports.findGitConfig = (filePath) => {
|
|
175
|
-
const
|
|
170
|
+
const fileSeparator = exports.getFileSeparatorData();
|
|
176
171
|
if(filePath == null || filePath == '' || filePath == fileSeparator) {
|
|
177
172
|
return null;
|
|
178
173
|
}
|
|
@@ -180,7 +175,7 @@ exports.findGitConfig = (filePath) => {
|
|
|
180
175
|
fs.statSync(filePath + fileSeparator + '.git' + fileSeparator + 'config');
|
|
181
176
|
return filePath;
|
|
182
177
|
} catch(e) {
|
|
183
|
-
let parentFilePath = filePath.split(
|
|
178
|
+
let parentFilePath = filePath.split(fileSeparator);
|
|
184
179
|
parentFilePath.pop();
|
|
185
180
|
return exports.findGitConfig(parentFilePath.join(fileSeparator));
|
|
186
181
|
}
|
|
@@ -1003,7 +998,7 @@ exports.runCypressTestsLocally = (bsConfig, args, rawArgs) => {
|
|
|
1003
998
|
const cypressProcess = spawn(
|
|
1004
999
|
'npx',
|
|
1005
1000
|
['cypress', 'run', ...getReRunSpecs(rawArgs.slice(1)), ...getLocalSessionReporter()],
|
|
1006
|
-
{ stdio: 'inherit', cwd: process.cwd(), env: process.env }
|
|
1001
|
+
{ stdio: 'inherit', cwd: process.cwd(), env: process.env, shell: true }
|
|
1007
1002
|
);
|
|
1008
1003
|
cypressProcess.on('close', async (code) => {
|
|
1009
1004
|
logger.info(`Cypress process exited with code ${code}`);
|
|
@@ -284,7 +284,7 @@ class MyReporter {
|
|
|
284
284
|
if(!isBrowserstackInfra()) gitConfigPath = process.env.OBSERVABILITY_GIT_CONFIG_PATH_LOCAL ? process.env.OBSERVABILITY_GIT_CONFIG_PATH_LOCAL.toString() : null;
|
|
285
285
|
const prefixedTestPath = rootParentFile ? this._paths.prefixTestPath(rootParentFile) : 'File path could not be found';
|
|
286
286
|
|
|
287
|
-
const
|
|
287
|
+
const fileSeparator = getFileSeparatorData();
|
|
288
288
|
|
|
289
289
|
let testData = {
|
|
290
290
|
'framework': 'Cypress',
|
|
@@ -309,11 +309,14 @@ class MyReporter {
|
|
|
309
309
|
'failure_type': !failureReason ? null : failureReason.match(/AssertionError/) ? 'AssertionError' : 'UnhandledError',
|
|
310
310
|
'retry_of': test.retryOf,
|
|
311
311
|
'meta': {
|
|
312
|
-
steps:
|
|
312
|
+
steps: []
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
if(eventType.match(/TestRunFinished/) || eventType.match(/TestRunSkipped/)) {
|
|
317
|
+
testData['meta'].steps = JSON.parse(JSON.stringify(this.currentTestCucumberSteps));
|
|
318
|
+
this.currentTestCucumberSteps = [];
|
|
319
|
+
}
|
|
317
320
|
|
|
318
321
|
const { os, os_version } = await getOSDetailsFromSystem(process.env.observability_product);
|
|
319
322
|
if(process.env.observability_integration) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browserstack-cypress-cli",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.2",
|
|
4
4
|
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"archiver": "5.3.0",
|
|
16
16
|
"async": "3.2.3",
|
|
17
|
-
"browserstack-local": "1.5.
|
|
17
|
+
"browserstack-local": "1.5.4",
|
|
18
18
|
"chalk": "4.1.2",
|
|
19
19
|
"cli-progress": "3.10.0",
|
|
20
20
|
"fs-extra": "8.1.0",
|