@devicecloud.dev/dcd 3.0.1 → 3.1.1-alpha.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.
@@ -54,6 +54,7 @@ export default class Cloud extends Command {
54
54
  orientation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
55
55
  quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
56
56
  retry: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
57
+ report: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
57
58
  };
58
59
  run(): Promise<void>;
59
60
  }
@@ -62,7 +62,7 @@ class Cloud extends core_1.Command {
62
62
  }
63
63
  await (0, methods_1.versionCheck)(this.config.version);
64
64
  const { args, flags, raw } = await this.parse(Cloud);
65
- const { 'additional-app-binary-ids': nonFlatAdditionalAppBinaryIds, 'additional-app-files': nonFlatAdditionalAppFiles, 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, async, 'device-locale': deviceLocale, 'download-artifacts': downloadArtifacts, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ios-device': iOSDevice, 'ios-version': iOSVersion, 'maestro-version': maestroVersion, name, orientation, quiet, retry, ...rest } = flags;
65
+ const { 'additional-app-binary-ids': nonFlatAdditionalAppBinaryIds, 'additional-app-files': nonFlatAdditionalAppFiles, 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, async, 'device-locale': deviceLocale, 'download-artifacts': downloadArtifacts, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ios-device': iOSDevice, 'ios-version': iOSVersion, 'maestro-version': maestroVersion, name, orientation, quiet, retry, report, ...rest } = flags;
66
66
  if (!apiKey)
67
67
  throw new Error('You must provide an API key');
68
68
  if (retry) {
@@ -71,6 +71,12 @@ class Cloud extends core_1.Command {
71
71
  if (retry > 3)
72
72
  throw new Error('Retry must be 3 or less');
73
73
  }
74
+ const [maestroMajorString, maestroMinorString] = maestroVersion.split('.');
75
+ if (report === 'html' &&
76
+ maestroMajorString === '1' &&
77
+ Number(maestroMinorString) < 39) {
78
+ throw new Error('HTML report is not supported for Maestro 1.38 and below. Please use --maestro-version flag to specify a newer runtime.');
79
+ }
74
80
  const additionalAppBinaryIds = nonFlatAdditionalAppBinaryIds?.flat();
75
81
  const additionalAppFiles = nonFlatAdditionalAppFiles?.flat();
76
82
  const { firstFile, secondFile } = args;
@@ -212,6 +218,7 @@ class Cloud extends core_1.Command {
212
218
  deviceLocale,
213
219
  maestroVersion,
214
220
  orientation,
221
+ report,
215
222
  raw: JSON.stringify(raw),
216
223
  uploadedBinaryIds,
217
224
  version: this.config.version,
@@ -24,6 +24,7 @@ export declare const flags: {
24
24
  orientation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
25
  quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
26
26
  retry: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
27
+ report: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
27
28
  };
28
29
  export declare const iOSCompatibilityLookup: {
29
30
  [k in EiOSDevices]: string[];
package/dist/constants.js CHANGED
@@ -141,6 +141,7 @@ exports.flags = {
141
141
  '1.39.2',
142
142
  '1.39.4',
143
143
  '1.39.5',
144
+ '1.39.7',
144
145
  ],
145
146
  }),
146
147
  name: core_1.Flags.string({
@@ -158,6 +159,11 @@ exports.flags = {
158
159
  retry: core_1.Flags.integer({
159
160
  description: 'Number of times to retry the run if it fails (same as pressing retry in the UI, this will deduct credits from your account)',
160
161
  }),
162
+ report: core_1.Flags.string({
163
+ aliases: ['format'],
164
+ description: 'Runs Maestro with the --format flag, this will generate a report in the specified format',
165
+ options: ['junit', 'html'],
166
+ }),
161
167
  };
162
168
  exports.iOSCompatibilityLookup = {
163
169
  'ipad-pro-6th-gen': ['16', '17', '18'],
package/dist/methods.js CHANGED
@@ -178,7 +178,7 @@ const parseInfoPlist = async (buffer) => {
178
178
  return data;
179
179
  };
180
180
  const extractAppMetadataIosZip = async (appFilePath) => new Promise((resolve, reject) => {
181
- const zip = new StreamZip({ file: './' + appFilePath });
181
+ const zip = new StreamZip({ file: appFilePath });
182
182
  zip.on('ready', () => {
183
183
  const infoPlist = Object.values(zip.entries()).find((e) => e.name.includes('Info.plist'));
184
184
  if (!infoPlist) {
@@ -235,7 +235,9 @@ const uploadBinary = async (filePath, apiUrl, apiKey) => {
235
235
  try {
236
236
  sha = await getFileHash(filePath);
237
237
  }
238
- catch {
238
+ catch (e) {
239
+ console.log('Failed to get file hash', e);
240
+ throw new Error('Failed to get file hash');
239
241
  // do nothing
240
242
  }
241
243
  let metadata;
package/dist/plan.js CHANGED
@@ -52,6 +52,9 @@ async function plan(input, includeTags, excludeTags, excludeFlows) {
52
52
  throw new Error(`Flow path does not exist: ${path.resolve(input)}`);
53
53
  }
54
54
  if (fs.lstatSync(input).isFile()) {
55
+ if (input.endsWith('config.yaml') || input.endsWith('config.yml')) {
56
+ throw new Error('If using config.yaml, pass the workspace folder path, not the config file');
57
+ }
55
58
  const checkedDependancies = await checkDependencies(input);
56
59
  return {
57
60
  flowsToRun: [input],
@@ -247,7 +247,8 @@
247
247
  "1.39.1",
248
248
  "1.39.2",
249
249
  "1.39.4",
250
- "1.39.5"
250
+ "1.39.5",
251
+ "1.39.7"
251
252
  ],
252
253
  "type": "option"
253
254
  },
@@ -284,6 +285,20 @@
284
285
  "hasDynamicHelp": false,
285
286
  "multiple": false,
286
287
  "type": "option"
288
+ },
289
+ "report": {
290
+ "aliases": [
291
+ "format"
292
+ ],
293
+ "description": "Runs Maestro with the --format flag, this will generate a report in the specified format",
294
+ "name": "report",
295
+ "hasDynamicHelp": false,
296
+ "multiple": false,
297
+ "options": [
298
+ "junit",
299
+ "html"
300
+ ],
301
+ "type": "option"
287
302
  }
288
303
  },
289
304
  "hasDynamicHelp": false,
@@ -302,5 +317,5 @@
302
317
  ]
303
318
  }
304
319
  },
305
- "version": "3.0.1"
320
+ "version": "3.1.1-alpha.0"
306
321
  }
package/package.json CHANGED
@@ -80,7 +80,7 @@
80
80
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
81
81
  "version": "oclif readme && git add README.md"
82
82
  },
83
- "version": "3.0.1",
83
+ "version": "3.1.1-alpha.0",
84
84
  "bugs": {
85
85
  "url": "https://discord.gg/gm3mJwcNw8"
86
86
  },