@devicecloud.dev/dcd 2.1.1 → 2.2.1
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/dist/commands/cloud.d.ts +9 -1
- package/dist/commands/cloud.js +36 -7
- package/dist/constants.d.ts +6 -2
- package/dist/constants.js +15 -4
- package/oclif.manifest.json +15 -3
- package/package.json +1 -1
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export declare enum EiOSDevices {
|
|
|
16
16
|
'iphone-16-pro' = "iphone-16-pro",
|
|
17
17
|
'iphone-16-pro-max' = "iphone-16-pro-max"
|
|
18
18
|
}
|
|
19
|
+
export declare enum EAndroidDevices {
|
|
20
|
+
'generic-tablet' = "generic-tablet",
|
|
21
|
+
'pixel-6' = "pixel-6",
|
|
22
|
+
'pixel-6-pro' = "pixel-6-pro",
|
|
23
|
+
'pixel-7' = "pixel-7",
|
|
24
|
+
'pixel-7-pro' = "pixel-7-pro"
|
|
25
|
+
}
|
|
19
26
|
export default class Cloud extends Command {
|
|
20
27
|
static args: {
|
|
21
28
|
firstFile: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
@@ -26,7 +33,7 @@ export default class Cloud extends Command {
|
|
|
26
33
|
static flags: {
|
|
27
34
|
'additional-app-binary-ids': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
28
35
|
'additional-app-files': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
29
|
-
'android-api-level': import("@oclif/core/lib/interfaces").OptionFlag<
|
|
36
|
+
'android-api-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
30
37
|
'android-device': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
31
38
|
apiKey: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
32
39
|
apiUrl: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -47,6 +54,7 @@ export default class Cloud extends Command {
|
|
|
47
54
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
48
55
|
orientation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
49
56
|
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
57
|
+
retry: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
50
58
|
};
|
|
51
59
|
run(): Promise<void>;
|
|
52
60
|
}
|
package/dist/commands/cloud.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EiOSDevices = exports.mimeTypeLookupByExtension = void 0;
|
|
3
|
+
exports.EAndroidDevices = exports.EiOSDevices = exports.mimeTypeLookupByExtension = void 0;
|
|
4
4
|
/* eslint-disable complexity */
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const cli_ux_1 = require("@oclif/core/lib/cli-ux");
|
|
@@ -31,6 +31,14 @@ var EiOSDevices;
|
|
|
31
31
|
EiOSDevices["iphone-16-pro"] = "iphone-16-pro";
|
|
32
32
|
EiOSDevices["iphone-16-pro-max"] = "iphone-16-pro-max";
|
|
33
33
|
})(EiOSDevices || (exports.EiOSDevices = EiOSDevices = {}));
|
|
34
|
+
var EAndroidDevices;
|
|
35
|
+
(function (EAndroidDevices) {
|
|
36
|
+
EAndroidDevices["generic-tablet"] = "generic-tablet";
|
|
37
|
+
EAndroidDevices["pixel-6"] = "pixel-6";
|
|
38
|
+
EAndroidDevices["pixel-6-pro"] = "pixel-6-pro";
|
|
39
|
+
EAndroidDevices["pixel-7"] = "pixel-7";
|
|
40
|
+
EAndroidDevices["pixel-7-pro"] = "pixel-7-pro";
|
|
41
|
+
})(EAndroidDevices || (exports.EAndroidDevices = EAndroidDevices = {}));
|
|
34
42
|
class Cloud extends core_1.Command {
|
|
35
43
|
static args = {
|
|
36
44
|
firstFile: core_1.Args.string({
|
|
@@ -55,9 +63,15 @@ class Cloud extends core_1.Command {
|
|
|
55
63
|
}
|
|
56
64
|
await (0, methods_1.versionCheck)(this.config.version);
|
|
57
65
|
const { args, flags, raw } = await this.parse(Cloud);
|
|
58
|
-
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, ...rest } = flags;
|
|
66
|
+
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;
|
|
59
67
|
if (!apiKey)
|
|
60
68
|
throw new Error('You must provide an API key');
|
|
69
|
+
if (retry) {
|
|
70
|
+
if (retry < 0)
|
|
71
|
+
throw new Error('Retry must be a positive number');
|
|
72
|
+
if (retry > 3)
|
|
73
|
+
throw new Error('Retry must be 3 or less');
|
|
74
|
+
}
|
|
61
75
|
const additionalAppBinaryIds = nonFlatAdditionalAppBinaryIds?.flat();
|
|
62
76
|
const additionalAppFiles = nonFlatAdditionalAppFiles?.flat();
|
|
63
77
|
const { firstFile, secondFile } = args;
|
|
@@ -79,7 +93,15 @@ class Cloud extends core_1.Command {
|
|
|
79
93
|
const supportediOSVersions = constants_1.iOSCompatibilityLookup[iOSDeviceID];
|
|
80
94
|
const version = iOSVersion || '17';
|
|
81
95
|
if (!supportediOSVersions.includes(version)) {
|
|
82
|
-
throw new Error(`${iOSDeviceID} only supports these iOS versions: ${supportediOSVersions.join(',')}`);
|
|
96
|
+
throw new Error(`${iOSDeviceID} only supports these iOS versions: ${supportediOSVersions.join(', ')}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (androidApiLevel || androidDevice) {
|
|
100
|
+
const androidDeviceID = androidDevice || 'pixel-7';
|
|
101
|
+
const supportedAndroidVersions = constants_1.AndroidCompatibilityLookup[androidDeviceID];
|
|
102
|
+
const version = androidApiLevel || '34';
|
|
103
|
+
if (!supportedAndroidVersions.includes(version)) {
|
|
104
|
+
throw new Error(`${androidDeviceID} only supports these Android API levels: ${supportedAndroidVersions.join(', ')}`);
|
|
83
105
|
}
|
|
84
106
|
}
|
|
85
107
|
flowFile = path.resolve(flowFile);
|
|
@@ -186,6 +208,7 @@ class Cloud extends core_1.Command {
|
|
|
186
208
|
const config = {
|
|
187
209
|
allExcludeTags,
|
|
188
210
|
allIncludeTags,
|
|
211
|
+
autoRetriesRemaining: retry,
|
|
189
212
|
continueOnFailure,
|
|
190
213
|
deviceLocale,
|
|
191
214
|
maestroVersion,
|
|
@@ -250,8 +273,8 @@ class Cloud extends core_1.Command {
|
|
|
250
273
|
if (!quiet) {
|
|
251
274
|
core_1.ux.action.status =
|
|
252
275
|
'\nStatus Test\n─────────── ───────────────';
|
|
253
|
-
for (const { status, test_file_name: test } of updatedResults) {
|
|
254
|
-
core_1.ux.action.status += `\n${status.padEnd(10, ' ')} ${test}`;
|
|
276
|
+
for (const { retry_of: isRetry, status, test_file_name: test, } of updatedResults) {
|
|
277
|
+
core_1.ux.action.status += `\n${status.padEnd(10, ' ')} ${test} ${isRetry ? '(retry)' : ''}`;
|
|
255
278
|
}
|
|
256
279
|
}
|
|
257
280
|
if (updatedResults.every((result) => !['PENDING', 'RUNNING'].includes(result.status))) {
|
|
@@ -259,7 +282,9 @@ class Cloud extends core_1.Command {
|
|
|
259
282
|
(0, cli_ux_1.info)('\n');
|
|
260
283
|
(0, cli_ux_1.table)(updatedResults, {
|
|
261
284
|
status: { get: (row) => row.status },
|
|
262
|
-
test: {
|
|
285
|
+
test: {
|
|
286
|
+
get: (row) => `${row.test_file_name} ${row.retry_of ? '(retry)' : ''}`,
|
|
287
|
+
},
|
|
263
288
|
}, { printLine: this.log.bind(this) });
|
|
264
289
|
(0, cli_ux_1.info)('\n');
|
|
265
290
|
(0, cli_ux_1.info)('Run completed, you can access the results at:');
|
|
@@ -282,7 +307,11 @@ class Cloud extends core_1.Command {
|
|
|
282
307
|
this.warn('Failed to download artifacts');
|
|
283
308
|
}
|
|
284
309
|
}
|
|
285
|
-
|
|
310
|
+
const resultsWithoutEarlierTries = updatedResults.filter((result) => {
|
|
311
|
+
const beenRetried = updatedResults.find((r) => r.retry_of === result.id);
|
|
312
|
+
return !beenRetried;
|
|
313
|
+
});
|
|
314
|
+
if (resultsWithoutEarlierTries.some((result) => result.status === 'FAILED')) {
|
|
286
315
|
// eslint-disable-next-line unicorn/no-process-exit
|
|
287
316
|
process.exit(2);
|
|
288
317
|
}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EiOSDevices } from './commands/cloud';
|
|
1
|
+
import { EAndroidDevices, EiOSDevices } from './commands/cloud';
|
|
2
2
|
export declare const flags: {
|
|
3
3
|
'additional-app-binary-ids': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
4
|
'additional-app-files': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
-
'android-api-level': import("@oclif/core/lib/interfaces").OptionFlag<
|
|
5
|
+
'android-api-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
6
|
'android-device': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
apiKey: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
8
|
apiUrl: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -23,7 +23,11 @@ export declare const flags: {
|
|
|
23
23
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
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
|
+
retry: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
27
|
};
|
|
27
28
|
export declare const iOSCompatibilityLookup: {
|
|
28
29
|
[k in EiOSDevices]: string[];
|
|
29
30
|
};
|
|
31
|
+
export declare const AndroidCompatibilityLookup: {
|
|
32
|
+
[k in EAndroidDevices]: string[];
|
|
33
|
+
};
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.iOSCompatibilityLookup = exports.flags = void 0;
|
|
3
|
+
exports.AndroidCompatibilityLookup = exports.iOSCompatibilityLookup = exports.flags = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
exports.flags = {
|
|
6
6
|
'additional-app-binary-ids': core_1.Flags.string({
|
|
@@ -17,9 +17,9 @@ exports.flags = {
|
|
|
17
17
|
multipleNonGreedy: true,
|
|
18
18
|
parse: (input) => input.split(','),
|
|
19
19
|
}),
|
|
20
|
-
'android-api-level': core_1.Flags.
|
|
20
|
+
'android-api-level': core_1.Flags.string({
|
|
21
21
|
description: '[Android only] Android API level to run your flow against',
|
|
22
|
-
options: ['33', '34', '35'],
|
|
22
|
+
options: ['29', '30', '31', '32', '33', '34', '35'],
|
|
23
23
|
}),
|
|
24
24
|
'android-device': core_1.Flags.string({
|
|
25
25
|
description: '[Android only] Android device to run your flow against',
|
|
@@ -121,7 +121,7 @@ exports.flags = {
|
|
|
121
121
|
}),
|
|
122
122
|
'maestro-version': core_1.Flags.string({
|
|
123
123
|
aliases: ['maestroVersion'],
|
|
124
|
-
description: '
|
|
124
|
+
description: 'Maestro version to run your flow against',
|
|
125
125
|
options: [
|
|
126
126
|
'1.36.0',
|
|
127
127
|
'1.37.0',
|
|
@@ -136,6 +136,7 @@ exports.flags = {
|
|
|
136
136
|
'1.37.9',
|
|
137
137
|
'1.38.1',
|
|
138
138
|
'1.39.0',
|
|
139
|
+
'1.39.1',
|
|
139
140
|
],
|
|
140
141
|
}),
|
|
141
142
|
name: core_1.Flags.string({
|
|
@@ -150,6 +151,9 @@ exports.flags = {
|
|
|
150
151
|
default: false,
|
|
151
152
|
description: 'Quieter console output that wont provide progress updates',
|
|
152
153
|
}),
|
|
154
|
+
retry: core_1.Flags.integer({
|
|
155
|
+
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)',
|
|
156
|
+
}),
|
|
153
157
|
};
|
|
154
158
|
exports.iOSCompatibilityLookup = {
|
|
155
159
|
'ipad-pro-6th-gen': ['16', '17', '18'],
|
|
@@ -167,3 +171,10 @@ exports.iOSCompatibilityLookup = {
|
|
|
167
171
|
'iphone-16-pro': ['18'],
|
|
168
172
|
'iphone-16-pro-max': ['18'],
|
|
169
173
|
};
|
|
174
|
+
exports.AndroidCompatibilityLookup = {
|
|
175
|
+
'generic-tablet': ['33', '34', '35'],
|
|
176
|
+
'pixel-6': ['29', '30', '31', '32', '33', '34', '35'],
|
|
177
|
+
'pixel-6-pro': ['33', '34', '35'],
|
|
178
|
+
'pixel-7': ['33', '34', '35'],
|
|
179
|
+
'pixel-7-pro': ['33', '34', '35'],
|
|
180
|
+
};
|
package/oclif.manifest.json
CHANGED
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"hasDynamicHelp": false,
|
|
42
42
|
"multiple": false,
|
|
43
43
|
"options": [
|
|
44
|
+
"29",
|
|
45
|
+
"30",
|
|
46
|
+
"31",
|
|
47
|
+
"32",
|
|
44
48
|
"33",
|
|
45
49
|
"34",
|
|
46
50
|
"35"
|
|
@@ -222,7 +226,7 @@
|
|
|
222
226
|
"aliases": [
|
|
223
227
|
"maestroVersion"
|
|
224
228
|
],
|
|
225
|
-
"description": "
|
|
229
|
+
"description": "Maestro version to run your flow against",
|
|
226
230
|
"name": "maestro-version",
|
|
227
231
|
"hasDynamicHelp": false,
|
|
228
232
|
"multiple": false,
|
|
@@ -239,7 +243,8 @@
|
|
|
239
243
|
"1.37.8",
|
|
240
244
|
"1.37.9",
|
|
241
245
|
"1.38.1",
|
|
242
|
-
"1.39.0"
|
|
246
|
+
"1.39.0",
|
|
247
|
+
"1.39.1"
|
|
243
248
|
],
|
|
244
249
|
"type": "option"
|
|
245
250
|
},
|
|
@@ -269,6 +274,13 @@
|
|
|
269
274
|
"name": "quiet",
|
|
270
275
|
"allowNo": false,
|
|
271
276
|
"type": "boolean"
|
|
277
|
+
},
|
|
278
|
+
"retry": {
|
|
279
|
+
"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)",
|
|
280
|
+
"name": "retry",
|
|
281
|
+
"hasDynamicHelp": false,
|
|
282
|
+
"multiple": false,
|
|
283
|
+
"type": "option"
|
|
272
284
|
}
|
|
273
285
|
},
|
|
274
286
|
"hasDynamicHelp": false,
|
|
@@ -287,5 +299,5 @@
|
|
|
287
299
|
]
|
|
288
300
|
}
|
|
289
301
|
},
|
|
290
|
-
"version": "2.
|
|
302
|
+
"version": "2.2.1"
|
|
291
303
|
}
|