browserstack-cypress-cli 1.24.1 → 1.24.3

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.
@@ -3,14 +3,13 @@
3
3
  const fs = require('fs'),
4
4
  path = require('path');
5
5
 
6
- const unzipper = require('unzipper');
7
-
8
6
  const logger = require('./logger').winstonLogger,
9
7
  utils = require("./utils"),
10
8
  Constants = require("./constants"),
11
9
  config = require("./config");
12
10
 
13
11
  const request = require('request');
12
+ const decompress = require('decompress');
14
13
 
15
14
 
16
15
  let BUILD_ARTIFACTS_TOTAL_COUNT = 0;
@@ -127,10 +126,13 @@ const downloadAndUnzip = async (filePath, fileName, url) => {
127
126
 
128
127
  const unzipFile = async (filePath, fileName) => {
129
128
  return new Promise( async (resolve, reject) => {
130
- await unzipper.Open.file(path.join(filePath, fileName))
131
- .then(d => d.extract({path: filePath, concurrency: 5}))
132
- .catch((err) => reject(err));
133
- resolve();
129
+ await decompress(path.join(filePath, fileName), filePath)
130
+ .then((files) => {
131
+ resolve();
132
+ })
133
+ .catch((error) => {
134
+ reject(error);
135
+ });
134
136
  });
135
137
  }
136
138
 
@@ -1,11 +1,11 @@
1
1
  const fs = require('fs'),
2
2
  path = require('path'),
3
3
  request = require('request'),
4
- unzipper = require('unzipper'),
5
4
  logger = require('./logger').winstonLogger,
6
5
  utils = require("./utils"),
7
6
  Constants = require('./constants'),
8
- config = require("./config");
7
+ config = require("./config"),
8
+ decompress = require('decompress');
9
9
 
10
10
  let reportGenerator = (bsConfig, buildId, args, rawArgs, buildReportData, cb) => {
11
11
  let options = {
@@ -150,14 +150,15 @@ function getReportResponse(filePath, fileName, reportJsonUrl) {
150
150
 
151
151
  const unzipFile = async (filePath, fileName) => {
152
152
  return new Promise( async (resolve, reject) => {
153
- await unzipper.Open.file(path.join(filePath, fileName))
154
- .then(d => d.extract({path: filePath, concurrency: 5}))
155
- .catch((err) => {
156
- reject(err);
157
- process.exitCode = Constants.ERROR_EXIT_CODE;
158
- });
153
+ await decompress(path.join(filePath, fileName), filePath)
154
+ .then((files) => {
159
155
  let message = "Unzipped the json and html successfully."
160
156
  resolve(message);
157
+ })
158
+ .catch((error) => {
159
+ reject(error);
160
+ process.exitCode = Constants.ERROR_EXIT_CODE;
161
+ });
161
162
  });
162
163
  }
163
164
 
@@ -741,6 +741,9 @@ exports.setTestObservabilityFlags = (bsConfig) => {
741
741
  /* testObservability */
742
742
  let isTestObservabilitySession = false;
743
743
  try {
744
+ /* set default again but under try catch in case of wrong config */
745
+ isTestObservabilitySession = utils.nonEmptyArray(bsConfig.run_settings.downloads) ? false : true;
746
+
744
747
  if(!utils.isUndefined(bsConfig["testObservability"])) isTestObservabilitySession = ( bsConfig["testObservability"] == true || bsConfig["testObservability"] == 1 );
745
748
  if(!utils.isUndefined(process.env.BROWSERSTACK_TEST_OBSERVABILITY)) isTestObservabilitySession = ( process.env.BROWSERSTACK_TEST_OBSERVABILITY == "true" || process.env.BROWSERSTACK_TEST_OBSERVABILITY == "1" );
746
749
  if(process.argv.includes('--disable-test-observability')) isTestObservabilitySession = false;
@@ -750,7 +753,6 @@ exports.setTestObservabilityFlags = (bsConfig) => {
750
753
  exports.debug(`EXCEPTION while parsing testObservability capability with error ${e}`, true, e);
751
754
  }
752
755
 
753
-
754
756
  /* browserstackAutomation */
755
757
  let isBrowserstackInfra = true;
756
758
  try {
@@ -762,6 +764,7 @@ exports.setTestObservabilityFlags = (bsConfig) => {
762
764
  exports.debug(`EXCEPTION while parsing browserstackAutomation capability with error ${e}`, true, e);
763
765
  }
764
766
 
767
+ if(isTestObservabilitySession) logger.warn("testObservability is set to true. Other test reporters you are using will be automatically disabled. Learn more at browserstack.com/docs/test-observability/overview/what-is-test-observability");
765
768
 
766
769
  process.env.BROWSERSTACK_TEST_OBSERVABILITY = isTestObservabilitySession;
767
770
  process.env.BROWSERSTACK_AUTOMATION = isBrowserstackInfra;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserstack-cypress-cli",
3
- "version": "1.24.1",
3
+ "version": "1.24.3",
4
4
  "description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,12 +29,12 @@
29
29
  "request": "2.88.2",
30
30
  "requestretry": "7.1.0",
31
31
  "table": "5.4.6",
32
- "unzipper": "0.10.11",
33
32
  "update-notifier": "5.1.0",
34
33
  "uuid": "8.3.2",
35
34
  "windows-release": "^5.1.0",
36
35
  "winston": "2.4.4",
37
- "yargs": "14.2.3"
36
+ "yargs": "14.2.3",
37
+ "decompress": "4.2.1"
38
38
  },
39
39
  "repository": {
40
40
  "type": "git",