browserstack-cypress-cli 1.31.6 → 1.31.8

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.
@@ -326,6 +326,9 @@ module.exports = function run(args, rawArgs) {
326
326
  }
327
327
  let message = `${data.message}! ${Constants.userMessages.BUILD_CREATED} with build id: ${data.build_id}`;
328
328
  let dashboardLink = `${Constants.userMessages.VISIT_DASHBOARD} ${data.dashboard_url}`;
329
+ if (turboScaleSession) {
330
+ dashboardLink = `${Constants.userMessages.VISIT_ATS_DASHBOARD} ${data.dashboard_url}`;
331
+ }
329
332
  buildReportData = { 'build_id': data.build_id, 'parallels': userSpecifiedParallels, ...buildReportData }
330
333
  utils.exportResults(data.build_id, `${config.dashboardUrl}${data.build_id}`);
331
334
  if ((utils.isUndefined(bsConfig.run_settings.parallels) && utils.isUndefined(args.parallels)) || (!utils.isUndefined(bsConfig.run_settings.parallels) && bsConfig.run_settings.parallels == Constants.cliMessages.RUN.DEFAULT_PARALLEL_MESSAGE)) {
@@ -388,6 +391,8 @@ module.exports = function run(args, rawArgs) {
388
391
  logger.info(Constants.userMessages.BUILD_FAILED_ERROR)
389
392
  process.exitCode = Constants.BUILD_FAILED_EXIT_CODE;
390
393
  });
394
+ } else {
395
+ utils.handleSyncExit(exitCode, data.dashboard_url);
391
396
  }
392
397
  });
393
398
  } else if (utils.nonEmptyArray(bsConfig.run_settings.downloads && !turboScaleSession)) {
@@ -72,9 +72,30 @@ const archiveSpecs = (runSettings, filePath, excludeFiles, md5data) => {
72
72
  });
73
73
  }
74
74
 
75
+ // Split mac and win configs
76
+ let macPackageJSON = {};
77
+ let winPackageJSON = {};
78
+ Object.assign(macPackageJSON, packageJSON);
79
+ Object.assign(winPackageJSON, packageJSON);
80
+
81
+ if (typeof runSettings.npm_dependencies === 'object') {
82
+ let macNpmDependencies = Object.assign({}, runSettings.npm_dependencies, runSettings.mac_npm_dependencies || {});
83
+ let winNpmDependencies = Object.assign({}, runSettings.npm_dependencies, runSettings.win_npm_dependencies || {});
84
+
85
+ Object.assign(macPackageJSON, {
86
+ devDependencies: macNpmDependencies,
87
+ });
88
+
89
+ Object.assign(winPackageJSON, {
90
+ devDependencies: winNpmDependencies,
91
+ });
92
+ }
93
+
75
94
  if (Object.keys(packageJSON).length > 0) {
76
- let packageJSONString = JSON.stringify(packageJSON, null, 4);
77
- archive.append(packageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-package.json`});
95
+ const macPackageJSONString = JSON.stringify(macPackageJSON, null, 4);
96
+ const winPackageJSONString = JSON.stringify(winPackageJSON, null, 4);
97
+ archive.append(macPackageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-mac-package.json`});
98
+ archive.append(winPackageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-win-package.json`});
78
99
  }
79
100
 
80
101
  //Create copy of package.json
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  const request = require('request');
3
+ const { combineMacWinNpmDependencies } = require('./helper');
3
4
 
4
5
  const crypto = require('crypto'),
5
6
  Constants = require('./constants'),
@@ -59,7 +60,7 @@ const checkPackageMd5 = (runSettings) => {
59
60
 
60
61
  if (typeof runSettings.npm_dependencies === 'object') {
61
62
  Object.assign(packageJSON, {
62
- devDependencies: utils.sortJsonKeys(runSettings.npm_dependencies),
63
+ devDependencies: utils.sortJsonKeys(combineMacWinNpmDependencies(runSettings)),
63
64
  });
64
65
  }
65
66
 
@@ -57,6 +57,7 @@ const userMessages = {
57
57
  FAILED_MD5_CHECK:
58
58
  "Something went wrong - you can retry running browserstack-cypress with ‘--force-upload’ parameter, or contact BrowserStack Support.",
59
59
  VISIT_DASHBOARD: "Visit the Automate dashboard for real-time test reporting:",
60
+ VISIT_ATS_DASHBOARD: "Visit the Automate TurboScale dashboard for real-time test reporting:",
60
61
  CONFLICTING_INIT_ARGUMENTS:
61
62
  "Conflicting arguments given. You can use --path only with a file name, and not with a file path.",
62
63
  NO_PARALLELS:
@@ -343,7 +344,11 @@ const filesToIgnoreWhileUploading = [
343
344
  "package.json",
344
345
  "**/package.json",
345
346
  "browserstack-package.json",
347
+ "browserstack-mac-package.json",
348
+ "browserstack-win-package.json",
346
349
  "**/browserstack-package.json",
350
+ "**/browserstack-mac-package.json",
351
+ "**/browserstack-win-package.json",
347
352
  "tests.zip",
348
353
  "**/tests.zip",
349
354
  "cypress.json",
@@ -441,3 +441,7 @@ exports.truncateString = (field, truncateSizeInBytes) => {
441
441
 
442
442
  return field;
443
443
  };
444
+
445
+ exports.combineMacWinNpmDependencies = (runSettings) => {
446
+ return Object.assign({}, runSettings.npm_dependencies, runSettings.win_npm_dependencies || {}, runSettings.mac_npm_dependencies || {})
447
+ };
@@ -12,6 +12,8 @@
12
12
  cliUtils = require("./utils"),
13
13
  util = require('util');
14
14
 
15
+ const { combineMacWinNpmDependencies } = require("./helper");
16
+
15
17
  let nodeProcess;
16
18
 
17
19
  const setupPackageFolder = (runSettings, directoryPath) => {
@@ -29,9 +31,10 @@ const setupPackageFolder = (runSettings, directoryPath) => {
29
31
  Object.assign(packageJSON, runSettings.package_config_options);
30
32
  }
31
33
 
34
+ // Combine win and mac specific dependencies if present
32
35
  if (typeof runSettings.npm_dependencies === 'object') {
33
36
  Object.assign(packageJSON, {
34
- devDependencies: runSettings.npm_dependencies,
37
+ devDependencies: combineMacWinNpmDependencies(runSettings),
35
38
  });
36
39
  }
37
40
 
@@ -222,6 +222,16 @@ exports.setDefaults = (bsConfig, args) => {
222
222
  bsConfig.run_settings.npm_dependencies = {}
223
223
  }
224
224
 
225
+ // setting win_npm_dependencies to {} if not present
226
+ if (bsConfig.run_settings && this.isUndefined(bsConfig.run_settings.win_npm_dependencies)) {
227
+ bsConfig.run_settings.win_npm_dependencies = {}
228
+ }
229
+
230
+ // setting mac_npm_dependencies to {} if not present
231
+ if (bsConfig.run_settings && this.isUndefined(bsConfig.run_settings.mac_npm_dependencies)) {
232
+ bsConfig.run_settings.mac_npm_dependencies = {}
233
+ }
234
+
225
235
  // setting connection_settings to {} if not present
226
236
  if (this.isUndefined(bsConfig.connection_settings)) {
227
237
  bsConfig.connection_settings = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserstack-cypress-cli",
3
- "version": "1.31.6",
3
+ "version": "1.31.8",
4
4
  "description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
5
5
  "main": "index.js",
6
6
  "scripts": {