browserstack-cypress-cli 1.12.1 → 1.13.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/commands/info.js +3 -0
- package/bin/commands/runs.js +3 -0
- package/bin/helpers/build.js +5 -1
- package/bin/helpers/buildArtifacts.js +4 -0
- package/bin/helpers/capabilityHelper.js +14 -0
- package/bin/helpers/checkUploaded.js +1 -1
- package/bin/helpers/constants.js +13 -5
- package/bin/helpers/reporterHTML.js +4 -4
- package/bin/helpers/utils.js +42 -0
- package/bin/helpers/zipUpload.js +10 -9
- package/bin/runner.js +6 -0
- package/bin/templates/configTemplate.js +1 -1
- package/package.json +25 -25
package/bin/commands/info.js
CHANGED
|
@@ -47,6 +47,7 @@ module.exports = function info(args, rawArgs) {
|
|
|
47
47
|
errorCode = 'api_failed_build_info';
|
|
48
48
|
|
|
49
49
|
logger.info(message);
|
|
50
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
50
51
|
} else {
|
|
51
52
|
let build = null;
|
|
52
53
|
try {
|
|
@@ -66,6 +67,7 @@ module.exports = function info(args, rawArgs) {
|
|
|
66
67
|
message = Constants.userMessages.API_DEPRECATED;
|
|
67
68
|
logger.info(message);
|
|
68
69
|
}
|
|
70
|
+
logger.info(utils.formatRequest(err, resp, body));
|
|
69
71
|
} else if (resp.statusCode != 200) {
|
|
70
72
|
messageType = Constants.messageTypes.ERROR;
|
|
71
73
|
errorCode = 'api_failed_build_info';
|
|
@@ -80,6 +82,7 @@ module.exports = function info(args, rawArgs) {
|
|
|
80
82
|
message = Constants.userMessages.BUILD_INFO_FAILED;
|
|
81
83
|
logger.error(message);
|
|
82
84
|
}
|
|
85
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
83
86
|
} else {
|
|
84
87
|
messageType = Constants.messageTypes.SUCCESS;
|
|
85
88
|
message = `Build info for build id: \n ${JSON.stringify(
|
package/bin/commands/runs.js
CHANGED
|
@@ -53,6 +53,9 @@ module.exports = function run(args, rawArgs) {
|
|
|
53
53
|
// set cypress geo location
|
|
54
54
|
utils.setGeolocation(bsConfig, args);
|
|
55
55
|
|
|
56
|
+
// set spec timeout
|
|
57
|
+
utils.setSpecTimeout(bsConfig, args);
|
|
58
|
+
|
|
56
59
|
// accept the specs list from command line if provided
|
|
57
60
|
utils.setUserSpecs(bsConfig, args);
|
|
58
61
|
|
package/bin/helpers/build.js
CHANGED
|
@@ -4,7 +4,8 @@ const request = require('request');
|
|
|
4
4
|
const config = require('./config'),
|
|
5
5
|
capabilityHelper = require("../helpers/capabilityHelper"),
|
|
6
6
|
Constants = require('../helpers/constants'),
|
|
7
|
-
utils = require('../helpers/utils')
|
|
7
|
+
utils = require('../helpers/utils'),
|
|
8
|
+
logger = require('../helpers/logger').winstonLogger;
|
|
8
9
|
|
|
9
10
|
const createBuild = (bsConfig, zip) => {
|
|
10
11
|
return new Promise(function (resolve, reject) {
|
|
@@ -24,6 +25,7 @@ const createBuild = (bsConfig, zip) => {
|
|
|
24
25
|
|
|
25
26
|
request.post(options, function (err, resp, body) {
|
|
26
27
|
if (err) {
|
|
28
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
27
29
|
reject(err);
|
|
28
30
|
} else {
|
|
29
31
|
let build = null;
|
|
@@ -37,9 +39,11 @@ const createBuild = (bsConfig, zip) => {
|
|
|
37
39
|
if (build) {
|
|
38
40
|
resolve(build.message);
|
|
39
41
|
} else {
|
|
42
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
40
43
|
reject(Constants.userMessages.API_DEPRECATED);
|
|
41
44
|
}
|
|
42
45
|
} else if (resp.statusCode != 201) {
|
|
46
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
43
47
|
if (build) {
|
|
44
48
|
reject(`${Constants.userMessages.BUILD_FAILED} Error: ${build.message}`);
|
|
45
49
|
} else {
|
|
@@ -162,6 +162,7 @@ const sendUpdatesToBstack = async (bsConfig, buildId, args, options, rawArgs) =>
|
|
|
162
162
|
request.post(options, function (err, resp, data) {
|
|
163
163
|
if(err) {
|
|
164
164
|
utils.sendUsageReport(bsConfig, args, err, Constants.messageTypes.ERROR, 'api_failed_build_artifacts_status_update', null, rawArgs);
|
|
165
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
165
166
|
reject(err);
|
|
166
167
|
} else {
|
|
167
168
|
try {
|
|
@@ -203,6 +204,7 @@ exports.downloadBuildArtifacts = async (bsConfig, buildId, args, rawArgs) => {
|
|
|
203
204
|
let buildDetails = null;
|
|
204
205
|
request.get(options, async function (err, resp, body) {
|
|
205
206
|
if(err) {
|
|
207
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
206
208
|
utils.sendUsageReport(bsConfig, args, err, Constants.messageTypes.ERROR, 'api_failed_build_artifacts', null, rawArgs);
|
|
207
209
|
process.exitCode = Constants.ERROR_EXIT_CODE;
|
|
208
210
|
} else {
|
|
@@ -211,6 +213,7 @@ exports.downloadBuildArtifacts = async (bsConfig, buildId, args, rawArgs) => {
|
|
|
211
213
|
if(resp.statusCode != 200) {
|
|
212
214
|
logger.error('Downloading the build artifacts failed.');
|
|
213
215
|
logger.error(`Error: Request failed with status code ${resp.statusCode}`)
|
|
216
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
214
217
|
utils.sendUsageReport(bsConfig, args, buildDetails, Constants.messageTypes.ERROR, 'api_failed_build_artifacts', null, rawArgs);
|
|
215
218
|
process.exitCode = Constants.ERROR_EXIT_CODE;
|
|
216
219
|
} else {
|
|
@@ -241,6 +244,7 @@ exports.downloadBuildArtifacts = async (bsConfig, buildId, args, rawArgs) => {
|
|
|
241
244
|
}
|
|
242
245
|
utils.sendUsageReport(bsConfig, args, err, messageType, errorCode, null, rawArgs);
|
|
243
246
|
logger.error(`Error: Request failed with status code ${resp.statusCode}`)
|
|
247
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
244
248
|
process.exitCode = Constants.ERROR_EXIT_CODE;
|
|
245
249
|
}
|
|
246
250
|
}
|
|
@@ -227,6 +227,20 @@ const validate = (bsConfig, args) => {
|
|
|
227
227
|
addCypressZipStartLocation(bsConfig.run_settings);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
if(!Utils.isUndefined(bsConfig.run_settings.spec_timeout)) {
|
|
231
|
+
if(Utils.isPositiveInteger(bsConfig.run_settings.spec_timeout.toString().trim())) {
|
|
232
|
+
if(Number(bsConfig.run_settings.spec_timeout) > Constants.SPEC_TIMEOUT_LIMIT) {
|
|
233
|
+
reject(Constants.validationMessages.SPEC_TIMEOUT_LIMIT_ERROR)
|
|
234
|
+
} else {
|
|
235
|
+
logger.info(Constants.userMessages.SPEC_LIMIT_SUCCESS_MESSAGE.replace("<x>", bsConfig.run_settings.spec_timeout));
|
|
236
|
+
}
|
|
237
|
+
} else {
|
|
238
|
+
logger.warn(Constants.userMessages.SPEC_TIMEOUT_LIMIT_WARNING)
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
logger.warn(Constants.validationMessages.SPEC_TIMEOUT_NOT_PASSED_ERROR);
|
|
242
|
+
}
|
|
243
|
+
|
|
230
244
|
resolve(cypressJson);
|
|
231
245
|
});
|
|
232
246
|
}
|
|
@@ -82,7 +82,7 @@ const checkUploadedMd5 = (bsConfig, args, instrumentBlocks) => {
|
|
|
82
82
|
zipUrlPresent: false,
|
|
83
83
|
packageUrlPresent: false,
|
|
84
84
|
};
|
|
85
|
-
if (args["force-upload"]
|
|
85
|
+
if (args["force-upload"]) {
|
|
86
86
|
return resolve(obj);
|
|
87
87
|
}
|
|
88
88
|
|
package/bin/helpers/constants.js
CHANGED
|
@@ -63,7 +63,9 @@ const userMessages = {
|
|
|
63
63
|
DOWNLOAD_BUILD_ARTIFACTS_SUCCESS: "Your build artifact(s) have been successfully downloaded in '<user-path>/build_artifacts/<build-id>' directory",
|
|
64
64
|
LATEST_SYNTAX_TO_ACTUAL_VERSION_MESSAGE: "Your build will run using Cypress <actualVersion> as you had specified <latestSyntaxVersion>.<frameworkUpgradeMessage> Read more about supported versions here: http://browserstack.com/docs/automate/cypress/supported-versions",
|
|
65
65
|
PROCESS_KILL_MESSAGE: "Stopping the CLI and the execution of the build on BrowserStack",
|
|
66
|
-
BUILD_FAILED_ERROR: "The above stacktrace has been thrown by Cypress when we tried to run your build. If your test suite requires npm dependencies then please specify them on browserstack.json. Read more at " + chalk.blueBright("https://www.browserstack.com/docs/automate/cypress/npm-packages") + ". Also, we recommend you to try running the build locally using ‘cypress run’ and if it works fine then please reach out to support at " + chalk.blueBright("https://www.browserstack.com/contact#technical-support")
|
|
66
|
+
BUILD_FAILED_ERROR: "The above stacktrace has been thrown by Cypress when we tried to run your build. If your test suite requires npm dependencies then please specify them on browserstack.json. Read more at " + chalk.blueBright("https://www.browserstack.com/docs/automate/cypress/npm-packages") + ". Also, we recommend you to try running the build locally using ‘cypress run’ and if it works fine then please reach out to support at " + chalk.blueBright("https://www.browserstack.com/contact#technical-support"),
|
|
67
|
+
SPEC_TIMEOUT_LIMIT_WARNING: "Value for the 'spec_timeout' key not in the 1-120 range. Going ahead with 30 mins as the default spec timeout. Read more about how to specify the option in https://browserstack.com/docs/automate/cypress/spec-timeout",
|
|
68
|
+
SPEC_LIMIT_SUCCESS_MESSAGE: "Spec timeout specified as <x> minutes. If any of your specs exceed the specified time limit, it would be forcibly killed by BrowserStack"
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
const validationMessages = {
|
|
@@ -97,7 +99,9 @@ const validationMessages = {
|
|
|
97
99
|
NOT_ALLOWED_GEO_LOCATION_AND_LOCAL_MODE: "IP Geolocation feature is not available in conjunction with BrowserStack Local.",
|
|
98
100
|
HOME_DIRECTORY_NOT_FOUND: "Specified home directory could not be found. Please make sure the path of the home directory is correct.",
|
|
99
101
|
HOME_DIRECTORY_NOT_A_DIRECTORY: "Specified home directory is not a directory. The home directory can only be a directory and not a file.",
|
|
100
|
-
CYPRESS_CONFIG_FILE_NOT_PART_OF_HOME_DIRECTORY: "Could not find cypress.json within the specified home directory. Please make sure cypress.json resides within the home directory."
|
|
102
|
+
CYPRESS_CONFIG_FILE_NOT_PART_OF_HOME_DIRECTORY: "Could not find cypress.json within the specified home directory. Please make sure cypress.json resides within the home directory.",
|
|
103
|
+
SPEC_TIMEOUT_LIMIT_ERROR: "The maximum allowed value of 'spec_timeout' is 120. Read more on https://browserstack.com/docs/automate/cypress/spec-timeout ",
|
|
104
|
+
SPEC_TIMEOUT_NOT_PASSED_ERROR: "'spec_timeout' key not specified. Going ahead with 30 mins as the default spec timeout. Read more about how to specify the option in https://browserstack.com/docs/automate/cypress/spec-timeout "
|
|
101
105
|
};
|
|
102
106
|
|
|
103
107
|
const cliMessages = {
|
|
@@ -140,7 +144,8 @@ const cliMessages = {
|
|
|
140
144
|
CONFIG_DESCRIPTION: "Set configuration values. Separate multiple values with a comma. The values set here override any values set in your configuration file.",
|
|
141
145
|
REPORTER: "Specify the custom reporter to use",
|
|
142
146
|
REPORTER_OPTIONS: "Specify reporter options for custom reporter",
|
|
143
|
-
CYPRESS_GEO_LOCATION: "Enterprise feature to simulate website and mobile behavior from different locations."
|
|
147
|
+
CYPRESS_GEO_LOCATION: "Enterprise feature to simulate website and mobile behavior from different locations.",
|
|
148
|
+
SPEC_TIMEOUT: "Specify a value for a hard timeout for each spec execution in the 1-120 mins range. Read https://browserstack.com/docs/automate/cypress/spec-timeout for more details."
|
|
144
149
|
},
|
|
145
150
|
COMMON: {
|
|
146
151
|
DISABLE_USAGE_REPORTING: "Disable usage reporting",
|
|
@@ -168,7 +173,7 @@ const messageTypes = {
|
|
|
168
173
|
NULL: null
|
|
169
174
|
}
|
|
170
175
|
|
|
171
|
-
const allowedFileTypes = ['js', 'json', 'txt', 'ts', 'feature', 'features', 'pdf', 'jpg', 'jpeg', 'png', 'zip', 'npmrc', 'xml', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'jsx', 'coffee', 'cjsx', 'csv', 'tsv', 'yml', 'yaml', 'env', 'mov', 'mp4', 'mp3', 'wav'];
|
|
176
|
+
const allowedFileTypes = ['js', 'json', 'txt', 'ts', 'feature', 'features', 'pdf', 'jpg', 'jpeg', 'png', 'zip', 'npmrc', 'xml', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'jsx', 'coffee', 'cjsx', 'csv', 'tsv', 'yml', 'yaml', 'env', 'mov', 'mp4', 'mp3', 'wav', 'gz', 'tgz', 'tiff', 'bmp', 'msg', 'gif', 'sql'];
|
|
172
177
|
|
|
173
178
|
const filesToIgnoreWhileUploading = [
|
|
174
179
|
'**/node_modules/**',
|
|
@@ -234,6 +239,8 @@ const REDACTED = "[REDACTED]";
|
|
|
234
239
|
|
|
235
240
|
const REDACTED_AUTH =`auth: { "username": ${REDACTED}, "access_key": ${REDACTED} }`;
|
|
236
241
|
|
|
242
|
+
const SPEC_TIMEOUT_LIMIT = 120 // IN MINS
|
|
243
|
+
|
|
237
244
|
module.exports = Object.freeze({
|
|
238
245
|
syncCLI,
|
|
239
246
|
userMessages,
|
|
@@ -254,5 +261,6 @@ module.exports = Object.freeze({
|
|
|
254
261
|
ERROR_EXIT_CODE,
|
|
255
262
|
AUTH_REGEX,
|
|
256
263
|
REDACTED_AUTH,
|
|
257
|
-
BUILD_FAILED_EXIT_CODE
|
|
264
|
+
BUILD_FAILED_EXIT_CODE,
|
|
265
|
+
SPEC_TIMEOUT_LIMIT
|
|
258
266
|
});
|
|
@@ -105,14 +105,14 @@ let reportGenerator = (bsConfig, buildId, args, rawArgs, cb) => {
|
|
|
105
105
|
let messageType = null;
|
|
106
106
|
let errorCode = null;
|
|
107
107
|
let build;
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
if (err) {
|
|
110
110
|
message = err;
|
|
111
111
|
messageType = Constants.messageTypes.ERROR;
|
|
112
112
|
errorCode = 'api_failed_build_report';
|
|
113
113
|
|
|
114
114
|
logger.error('Generating the build report failed.');
|
|
115
|
-
logger.error(
|
|
115
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
116
116
|
|
|
117
117
|
utils.sendUsageReport(bsConfig, args, message, messageType, errorCode, null, rawArgs);
|
|
118
118
|
return;
|
|
@@ -145,7 +145,7 @@ let reportGenerator = (bsConfig, buildId, args, rawArgs, cb) => {
|
|
|
145
145
|
logger.error(`Error generating the report: ${error}`);
|
|
146
146
|
response = {message: message};
|
|
147
147
|
}
|
|
148
|
-
logger.error(
|
|
148
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
149
149
|
} else if (resp.statusCode != 200) {
|
|
150
150
|
messageType = Constants.messageTypes.ERROR;
|
|
151
151
|
errorCode = 'api_failed_build_generate_report';
|
|
@@ -158,7 +158,7 @@ let reportGenerator = (bsConfig, buildId, args, rawArgs, cb) => {
|
|
|
158
158
|
if (build.message === 'Unauthorized') errorCode = 'api_auth_failed';
|
|
159
159
|
} else {
|
|
160
160
|
message = Constants.userMessages.BUILD_GENERATE_REPORT_FAILED.replace('<build-id>', buildId);
|
|
161
|
-
logger.error(
|
|
161
|
+
logger.error(utils.formatRequest(err, resp, body));
|
|
162
162
|
}
|
|
163
163
|
} else {
|
|
164
164
|
messageType = Constants.messageTypes.SUCCESS;
|
package/bin/helpers/utils.js
CHANGED
|
@@ -7,6 +7,7 @@ const getmac = require('getmac').default;
|
|
|
7
7
|
const { v4: uuidv4 } = require('uuid');
|
|
8
8
|
const browserstack = require('browserstack-local');
|
|
9
9
|
const crypto = require('crypto');
|
|
10
|
+
const util = require('util');
|
|
10
11
|
|
|
11
12
|
const usageReporting = require("./usageReporting"),
|
|
12
13
|
logger = require("./logger").winstonLogger,
|
|
@@ -309,6 +310,23 @@ exports.setGeolocation = (bsConfig, args) => {
|
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
312
|
|
|
313
|
+
exports.isSpecTimeoutArgPassed = () => {
|
|
314
|
+
return this.searchForOption('--spec-timeout') || this.searchForOption('-t');
|
|
315
|
+
}
|
|
316
|
+
exports.setSpecTimeout = (bsConfig, args) => {
|
|
317
|
+
let specTimeout = null;
|
|
318
|
+
if(this.isSpecTimeoutArgPassed()) {
|
|
319
|
+
if(!this.isUndefined(args.specTimeout)) {
|
|
320
|
+
specTimeout = args.specTimeout;
|
|
321
|
+
} else {
|
|
322
|
+
specTimeout = 'undefined'
|
|
323
|
+
}
|
|
324
|
+
} else if (!this.isUndefined(bsConfig.run_settings.spec_timeout)) {
|
|
325
|
+
specTimeout = bsConfig.run_settings.spec_timeout;
|
|
326
|
+
}
|
|
327
|
+
bsConfig.run_settings.spec_timeout = specTimeout;
|
|
328
|
+
}
|
|
329
|
+
|
|
312
330
|
// specs can be passed from bstack configuration file
|
|
313
331
|
// specs can be passed via command line args as a string
|
|
314
332
|
// command line args takes precedence over config
|
|
@@ -389,10 +407,26 @@ exports.fixCommaSeparatedString = (string) => {
|
|
|
389
407
|
|
|
390
408
|
exports.isUndefined = value => (value === undefined || value === null);
|
|
391
409
|
|
|
410
|
+
exports.isPositiveInteger = (str) => {
|
|
411
|
+
if (typeof str !== 'string') {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
const num = Number(str);
|
|
416
|
+
|
|
417
|
+
if (this.isInteger(num) && num > 0) {
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
|
|
392
424
|
exports.isTrueString = value => (!this.isUndefined(value) && value.toString().toLowerCase() === 'true');
|
|
393
425
|
|
|
394
426
|
exports.isFloat = (value) => Number(value) && Number(value) % 1 !== 0;
|
|
395
427
|
|
|
428
|
+
exports.isInteger = (value) => Number.isInteger(value);
|
|
429
|
+
|
|
396
430
|
exports.nonEmptyArray = (value) => {
|
|
397
431
|
if(!this.isUndefined(value) && value && value.length) {
|
|
398
432
|
return true;
|
|
@@ -969,6 +1003,14 @@ exports.setCLIMode = (bsConfig, args) => {
|
|
|
969
1003
|
}
|
|
970
1004
|
}
|
|
971
1005
|
|
|
1006
|
+
exports.formatRequest = (err, resp, body) => {
|
|
1007
|
+
return {
|
|
1008
|
+
err,
|
|
1009
|
+
status: resp ? resp.statusCode : null,
|
|
1010
|
+
body: body ? util.format('%j', body) : null
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
972
1014
|
exports.stopBrowserStackBuild = async (bsConfig, args, buildId, rawArgs) => {
|
|
973
1015
|
let that = this;
|
|
974
1016
|
return new Promise(function (resolve, reject) {
|
package/bin/helpers/zipUpload.js
CHANGED
|
@@ -52,7 +52,7 @@ const uploadSuits = (bsConfig, filePath, opts, obj) => {
|
|
|
52
52
|
var r = request.post(options, function (err, resp, body) {
|
|
53
53
|
|
|
54
54
|
if (err) {
|
|
55
|
-
reject(err);
|
|
55
|
+
reject({message: err, stacktrace: utils.formatRequest(err, resp, body)});
|
|
56
56
|
} else {
|
|
57
57
|
try {
|
|
58
58
|
responseData = JSON.parse(body);
|
|
@@ -63,9 +63,9 @@ const uploadSuits = (bsConfig, filePath, opts, obj) => {
|
|
|
63
63
|
if (resp.statusCode == 401) {
|
|
64
64
|
if (responseData && responseData["error"]) {
|
|
65
65
|
responseData["time"] = Date.now() - obj.startTime;
|
|
66
|
-
return reject(responseData["error"]);
|
|
66
|
+
return reject({message: responseData["error"], stacktrace: utils.formatRequest(err, resp, body)});
|
|
67
67
|
} else {
|
|
68
|
-
return reject(Constants.validationMessages.INVALID_DEFAULT_AUTH_PARAMS);
|
|
68
|
+
return reject({message: Constants.validationMessages.INVALID_DEFAULT_AUTH_PARAMS, stacktrace: utils.formatRequest(err, resp, body)});
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
if (!opts.propogateError){
|
|
@@ -73,12 +73,12 @@ const uploadSuits = (bsConfig, filePath, opts, obj) => {
|
|
|
73
73
|
}
|
|
74
74
|
if(responseData && responseData["error"]){
|
|
75
75
|
responseData["time"] = Date.now() - obj.startTime;
|
|
76
|
-
reject(responseData["error"]);
|
|
76
|
+
reject({message: responseData["error"], stacktrace: utils.formatRequest(err, resp, body)});
|
|
77
77
|
} else {
|
|
78
78
|
if (resp.statusCode == 413) {
|
|
79
|
-
reject(Constants.userMessages.ZIP_UPLOAD_LIMIT_EXCEEDED);
|
|
79
|
+
reject({message: Constants.userMessages.ZIP_UPLOAD_LIMIT_EXCEEDED, stacktrace: utils.formatRequest(err, resp, body)});
|
|
80
80
|
} else {
|
|
81
|
-
reject(Constants.userMessages.ZIP_UPLOADER_NOT_REACHABLE);
|
|
81
|
+
reject({message: Constants.userMessages.ZIP_UPLOADER_NOT_REACHABLE, stacktrace: utils.formatRequest(err, resp, body)});
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
} else {
|
|
@@ -147,9 +147,10 @@ const uploadCypressZip = (bsConfig, md5data, packageData) => {
|
|
|
147
147
|
});
|
|
148
148
|
return resolve(obj);
|
|
149
149
|
}).catch((error) => {
|
|
150
|
-
purgeUploadBar(testZipUploadObj);
|
|
151
|
-
purgeUploadBar(npmPackageZipUploadObj);
|
|
152
|
-
|
|
150
|
+
testZipUploadObj.bar1 && purgeUploadBar(testZipUploadObj);
|
|
151
|
+
npmPackageZipUploadObj.bar1 && purgeUploadBar(npmPackageZipUploadObj);
|
|
152
|
+
logger.error(error.stacktrace)
|
|
153
|
+
return reject(error.message);
|
|
153
154
|
})
|
|
154
155
|
})
|
|
155
156
|
}
|
package/bin/runner.js
CHANGED
|
@@ -168,6 +168,12 @@ var argv = yargs
|
|
|
168
168
|
type: "string",
|
|
169
169
|
default: undefined
|
|
170
170
|
},
|
|
171
|
+
't': {
|
|
172
|
+
alias: ['specTimeout'],
|
|
173
|
+
default: undefined,
|
|
174
|
+
describe: Constants.cliMessages.RUN.SPEC_TIMEOUT,
|
|
175
|
+
type: "string"
|
|
176
|
+
},
|
|
171
177
|
'disable-npm-warning': {
|
|
172
178
|
default: false,
|
|
173
179
|
description: Constants.cliMessages.COMMON.NO_NPM_WARNING,
|
|
@@ -56,7 +56,7 @@ module.exports = function () {
|
|
|
56
56
|
"project_name": "project-name",
|
|
57
57
|
"build_name": "build-name",
|
|
58
58
|
"exclude": [],
|
|
59
|
-
"parallels": "
|
|
59
|
+
"parallels": "Number of parallels you want to run",
|
|
60
60
|
"npm_dependencies": {
|
|
61
61
|
},
|
|
62
62
|
"package_config_options": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browserstack-cypress-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
"browserstack-cypress": "bin/runner.js"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"archiver": "
|
|
16
|
-
"async": "
|
|
17
|
-
"browserstack-local": "
|
|
18
|
-
"chalk": "
|
|
19
|
-
"cli-progress": "
|
|
20
|
-
"fs-extra": "
|
|
21
|
-
"getmac": "
|
|
22
|
-
"glob": "
|
|
23
|
-
"mkdirp": "
|
|
24
|
-
"request": "
|
|
25
|
-
"requestretry": "
|
|
26
|
-
"table": "
|
|
27
|
-
"unzipper": "
|
|
28
|
-
"update-notifier": "
|
|
29
|
-
"uuid": "
|
|
15
|
+
"archiver": "5.3.0",
|
|
16
|
+
"async": "3.2.3",
|
|
17
|
+
"browserstack-local": "1.4.8",
|
|
18
|
+
"chalk": "4.1.2",
|
|
19
|
+
"cli-progress": "3.10.0",
|
|
20
|
+
"fs-extra": "8.1.0",
|
|
21
|
+
"getmac": "5.20.0",
|
|
22
|
+
"glob": "7.2.0",
|
|
23
|
+
"mkdirp": "1.0.4",
|
|
24
|
+
"request": "2.88.2",
|
|
25
|
+
"requestretry": "4.1.2",
|
|
26
|
+
"table": "5.4.6",
|
|
27
|
+
"unzipper": "0.10.11",
|
|
28
|
+
"update-notifier": "5.1.0",
|
|
29
|
+
"uuid": "8.3.2",
|
|
30
30
|
"winston": "2.4.4",
|
|
31
|
-
"yargs": "
|
|
31
|
+
"yargs": "14.2.3"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"url": "https://github.com/browserstack/browserstack-cypress-cli/issues"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"chai": "
|
|
43
|
-
"chai-as-promised": "
|
|
44
|
-
"custom-env": "
|
|
45
|
-
"mocha": "
|
|
46
|
-
"nyc": "
|
|
47
|
-
"proxyquire": "
|
|
48
|
-
"rewire": "
|
|
49
|
-
"sinon": "
|
|
42
|
+
"chai": "4.3.6",
|
|
43
|
+
"chai-as-promised": "7.1.1",
|
|
44
|
+
"custom-env": "2.0.1",
|
|
45
|
+
"mocha": "7.2.0",
|
|
46
|
+
"nyc": "15.1.0",
|
|
47
|
+
"proxyquire": "2.1.3",
|
|
48
|
+
"rewire": "5.0.0",
|
|
49
|
+
"sinon": "9.2.4"
|
|
50
50
|
}
|
|
51
51
|
}
|