@testim/testim-cli 3.267.0 → 3.269.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/runOptions.js CHANGED
@@ -220,6 +220,7 @@ program
220
220
  .option('--device-model [device-model]', 'The device model to use, iPhone 12, Nexus 5X, SM-G900P etc....')
221
221
  .option('--device-udid [device-udid]', 'the device unique id')
222
222
  .option('--os-version [os-version]', 'The operating system version number')
223
+ .option('--app-id [app-id]', 'The application id from app library on Testim Editor App')
223
224
 
224
225
  .option('-str --suppress-tms-reporting [suppress-tms-reporting]', 'disable test management reporting', false)
225
226
  .option('-tsr --tms-suppress-reporting [tms-suppress-reporting]', 'disable test management reporting', false)
@@ -1037,7 +1038,6 @@ module.exports = {
1037
1038
  if (program.deviceUdid && (program.deviceModel || program.osVersion)) {
1038
1039
  throw new ArgError('It is not possible to use --osVersion or --deviceModel with --device-udid. device-udid is unique and cannot be combined with another flag');
1039
1040
  }
1040
-
1041
1041
  if (program.lightweightMode) {
1042
1042
  try {
1043
1043
  const DEFAULTS = {
@@ -1154,10 +1154,11 @@ module.exports = {
1154
1154
  retentionDays: program.setRetention,
1155
1155
  passZeroTests: Boolean(program.passZeroTests),
1156
1156
  runQuarantinedTests: Boolean(program.runQuarantinedTests),
1157
-
1157
+ //Mobile-Flags
1158
1158
  deviceModel: program.deviceModel,
1159
1159
  deviceUdid: program.deviceUdid,
1160
1160
  osVersion: program.osVersion,
1161
+ appId: program.appId,
1161
1162
 
1162
1163
  // Extension
1163
1164
  ext: program.ext,
package/runner.js CHANGED
@@ -254,7 +254,7 @@ async function runRunner(options, customExtensionLocalLocation) {
254
254
  options.source = (useLocalChromeDriver || useChromeLauncher) ? 'cli-local' : 'cli';
255
255
  }
256
256
 
257
- npmDriver.checkNpmVersion();
257
+ await npmDriver.checkNpmVersion();
258
258
  perf.log('in runner.js after checkNpmVersion');
259
259
 
260
260
  await validateCliAccount(options);
@@ -1,24 +1,28 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  const service = require('../agent/routers/cliJsCode/service');
4
- const Promise = require('bluebird');
5
- const {NpmPackageError} = require('../errors');
4
+ const { NpmPackageError } = require('../errors');
5
+ const utils = require('../utils');
6
6
 
7
- module.exports.run = (browser, step) => {
8
- const {stepId, testResultId, retryIndex, stepResultId, packageData, timeout} = step.data;
9
- return service.installPackage(stepId, testResultId, retryIndex, packageData, stepResultId, timeout)
10
- .then(data => ({data, success: true}))
11
- .catch(NpmPackageError, err => {
7
+ module.exports.run = async (browser, step) => {
8
+ const { stepId, testResultId, retryIndex, stepResultId, packageData, timeout } = step.data;
9
+ try {
10
+ const data = await service.installPackage(stepId, testResultId, retryIndex, packageData, stepResultId, timeout);
11
+ return { data, success: true };
12
+ } catch (err) {
13
+ if (err instanceof NpmPackageError) {
12
14
  return {
13
15
  success: false,
14
- code: "invalid-node-package",
15
- message: err.message
16
+ code: 'invalid-node-package',
17
+ message: err.message,
16
18
  };
17
- })
18
- .catch(Promise.TimeoutError, () => {
19
+ }
20
+ if (err instanceof utils.TimeoutError) {
19
21
  return {
20
22
  success: false,
21
- code: "timeout"
23
+ code: 'timeout',
22
24
  };
23
- });
25
+ }
26
+ throw err;
27
+ }
24
28
  };