@devicecloud.dev/dcd 3.5.1 → 3.6.2
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 +2 -0
- package/dist/commands/cloud.js +16 -2
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +9 -2
- package/dist/plan.d.ts +1 -1
- package/dist/plan.js +18 -4
- package/oclif.manifest.json +17 -3
- package/package.json +2 -3
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -34,11 +34,13 @@ export default class Cloud extends Command {
|
|
|
34
34
|
'additional-app-files': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
35
35
|
'android-api-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
36
36
|
'android-device': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
37
|
+
'skip-chrome-onboarding': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
37
38
|
apiKey: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
38
39
|
apiUrl: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
39
40
|
'app-binary-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
40
41
|
'app-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
41
42
|
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
43
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
42
44
|
'device-locale': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
43
45
|
'download-artifacts': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
44
46
|
'artifacts-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
package/dist/commands/cloud.js
CHANGED
|
@@ -80,7 +80,7 @@ class Cloud extends core_1.Command {
|
|
|
80
80
|
let output = null;
|
|
81
81
|
try {
|
|
82
82
|
const { args, flags, raw } = await this.parse(Cloud);
|
|
83
|
-
let { 'additional-app-binary-ids': nonFlatAdditionalAppBinaryIds, 'additional-app-files': nonFlatAdditionalAppFiles, 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey: apiKeyFlag, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, 'artifacts-path': artifactsPath, async, 'device-locale': deviceLocale, 'download-artifacts': downloadArtifacts, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ignore-sha-check': ignoreShaCheck, 'ios-device': iOSDevice, 'ios-version': iOSVersion, 'maestro-version': maestroVersion, name, orientation, quiet, retry, report, 'runner-type': runnerType, 'x86-arch': x86Arch, json, ...rest } = flags;
|
|
83
|
+
let { 'additional-app-binary-ids': nonFlatAdditionalAppBinaryIds, 'additional-app-files': nonFlatAdditionalAppFiles, 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey: apiKeyFlag, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, 'artifacts-path': artifactsPath, async, config: configFile, 'device-locale': deviceLocale, 'download-artifacts': downloadArtifacts, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ignore-sha-check': ignoreShaCheck, 'ios-device': iOSDevice, 'ios-version': iOSVersion, 'maestro-version': maestroVersion, name, orientation, quiet, retry, report, 'runner-type': runnerType, 'x86-arch': x86Arch, json, ...rest } = flags;
|
|
84
84
|
// If in JSON mode, temporarily intercept stdout to suppress the warning
|
|
85
85
|
if (json) {
|
|
86
86
|
const originalStdoutWrite = process.stdout.write;
|
|
@@ -118,6 +118,19 @@ class Cloud extends core_1.Command {
|
|
|
118
118
|
throw new Error('runnerType m4 only supports iOS');
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
if (runnerType === 'm1') {
|
|
122
|
+
this.log('Note: Runner Type m1 is experimental and currently supports Android only, iOS will revert to default.');
|
|
123
|
+
// todo - better platform checking
|
|
124
|
+
if (iOSDevice || iOSVersion) {
|
|
125
|
+
this.log('runnerType m1 only supports Android, reverting to default');
|
|
126
|
+
runnerType = 'default';
|
|
127
|
+
}
|
|
128
|
+
if (androidApiLevel || androidDevice) {
|
|
129
|
+
this.log('Runner Type m1 only supports API Level 34 and Pixel 7, unsetting your android options.');
|
|
130
|
+
androidApiLevel = undefined;
|
|
131
|
+
androidDevice = undefined;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
121
134
|
const additionalAppBinaryIds = nonFlatAdditionalAppBinaryIds?.flat();
|
|
122
135
|
const additionalAppFiles = nonFlatAdditionalAppFiles?.flat();
|
|
123
136
|
const { firstFile, secondFile } = args;
|
|
@@ -164,7 +177,7 @@ class Cloud extends core_1.Command {
|
|
|
164
177
|
}
|
|
165
178
|
let executionPlan;
|
|
166
179
|
try {
|
|
167
|
-
executionPlan = await (0, plan_1.plan)(flowFile, includeTags.flat(), excludeTags.flat(), excludeFlows.flat());
|
|
180
|
+
executionPlan = await (0, plan_1.plan)(flowFile, includeTags.flat(), excludeTags.flat(), excludeFlows.flat(), configFile);
|
|
168
181
|
}
|
|
169
182
|
catch (error) {
|
|
170
183
|
throw error;
|
|
@@ -268,6 +281,7 @@ class Cloud extends core_1.Command {
|
|
|
268
281
|
raw: JSON.stringify(raw),
|
|
269
282
|
uploadedBinaryIds,
|
|
270
283
|
version: this.config.version,
|
|
284
|
+
skipChromeOnboarding: flags['skip-chrome-onboarding'],
|
|
271
285
|
};
|
|
272
286
|
if (finalAdditionalBinaryIds?.length > 0) {
|
|
273
287
|
config.additionalAppBinaryIds = finalAdditionalBinaryIds;
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ export declare const flags: {
|
|
|
4
4
|
'additional-app-files': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
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
|
+
'skip-chrome-onboarding': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
apiKey: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
9
|
apiUrl: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
10
|
'app-binary-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
11
|
'app-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
12
|
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
14
|
'device-locale': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
15
|
'download-artifacts': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
16
|
'artifacts-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
package/dist/constants.js
CHANGED
|
@@ -31,6 +31,10 @@ exports.flags = {
|
|
|
31
31
|
'generic-tablet',
|
|
32
32
|
],
|
|
33
33
|
}),
|
|
34
|
+
'skip-chrome-onboarding': core_1.Flags.boolean({
|
|
35
|
+
description: '[Android only] Skip Chrome browser onboarding screens when running tests',
|
|
36
|
+
default: false,
|
|
37
|
+
}),
|
|
34
38
|
apiKey: core_1.Flags.string({
|
|
35
39
|
aliases: ['api-key'],
|
|
36
40
|
description: 'API key for devicecloud.dev (find this in the console UI). You can also set the DEVICE_CLOUD_API_KEY environment variable.',
|
|
@@ -52,6 +56,9 @@ exports.flags = {
|
|
|
52
56
|
async: core_1.Flags.boolean({
|
|
53
57
|
description: 'Immediately return (exit code 0) from the command without waiting for the results of the run (useful for saving CI minutes)',
|
|
54
58
|
}),
|
|
59
|
+
config: core_1.Flags.file({
|
|
60
|
+
description: 'Path to custom config.yaml file. If not provided, defaults to config.yaml in root flows folders.',
|
|
61
|
+
}),
|
|
55
62
|
'device-locale': core_1.Flags.string({
|
|
56
63
|
description: 'Locale that will be set to a device, ISO-639-1 code and uppercase ISO-3166-1 code e.g. "de_DE" for Germany',
|
|
57
64
|
}),
|
|
@@ -166,9 +173,9 @@ exports.flags = {
|
|
|
166
173
|
description: 'Automatically retry the run up to the number of times specified (same as pressing retry in the UI) - this is free of charge',
|
|
167
174
|
}),
|
|
168
175
|
'runner-type': core_1.Flags.string({
|
|
169
|
-
description: '[
|
|
176
|
+
description: '[experimental] The type of runner to use - note: anything other than default will incur premium pricing tiers, see https://docs.devicecloud.dev/reference/runner-type for more information',
|
|
170
177
|
default: 'default',
|
|
171
|
-
options: ['default', 'm4'],
|
|
178
|
+
options: ['default', 'm4', 'm1'],
|
|
172
179
|
}),
|
|
173
180
|
report: core_1.Flags.string({
|
|
174
181
|
aliases: ['format'],
|
package/dist/plan.d.ts
CHANGED
|
@@ -25,5 +25,5 @@ interface IFlowSequence {
|
|
|
25
25
|
continueOnFailure?: boolean;
|
|
26
26
|
flows: string[];
|
|
27
27
|
}
|
|
28
|
-
export declare function plan(input: string, includeTags: string[], excludeTags: string[], excludeFlows?: string[]): Promise<IExecutionPlan>;
|
|
28
|
+
export declare function plan(input: string, includeTags: string[], excludeTags: string[], excludeFlows?: string[], configFile?: string): Promise<IExecutionPlan>;
|
|
29
29
|
export {};
|
package/dist/plan.js
CHANGED
|
@@ -52,7 +52,7 @@ function getWorkspaceConfig(input, unfilteredFlowFiles) {
|
|
|
52
52
|
: {};
|
|
53
53
|
return config;
|
|
54
54
|
}
|
|
55
|
-
async function plan(input, includeTags, excludeTags, excludeFlows) {
|
|
55
|
+
async function plan(input, includeTags, excludeTags, excludeFlows, configFile) {
|
|
56
56
|
const normalizedInput = path.normalize(input);
|
|
57
57
|
if (!fs.existsSync(normalizedInput)) {
|
|
58
58
|
throw new Error(`Flow path does not exist: ${path.resolve(normalizedInput)}`);
|
|
@@ -60,7 +60,7 @@ async function plan(input, includeTags, excludeTags, excludeFlows) {
|
|
|
60
60
|
if (fs.lstatSync(normalizedInput).isFile()) {
|
|
61
61
|
if (normalizedInput.endsWith('config.yaml') ||
|
|
62
62
|
normalizedInput.endsWith('config.yml')) {
|
|
63
|
-
throw new Error('If using config.yaml, pass the workspace folder path, not the config file');
|
|
63
|
+
throw new Error('If using config.yaml, pass the workspace folder path, not the config file or a custom path via --config');
|
|
64
64
|
}
|
|
65
65
|
const checkedDependancies = await checkDependencies(normalizedInput);
|
|
66
66
|
return {
|
|
@@ -74,7 +74,17 @@ async function plan(input, includeTags, excludeTags, excludeFlows) {
|
|
|
74
74
|
throw new Error(`Flow directory does not contain any Flow files: ${path.resolve(normalizedInput)}`);
|
|
75
75
|
}
|
|
76
76
|
unfilteredFlowFiles = filterFlowFiles(unfilteredFlowFiles, excludeFlows);
|
|
77
|
-
|
|
77
|
+
let workspaceConfig;
|
|
78
|
+
if (configFile) {
|
|
79
|
+
const configFilePath = path.resolve(process.cwd(), configFile);
|
|
80
|
+
if (!fs.existsSync(configFilePath)) {
|
|
81
|
+
throw new Error(`Config file does not exist: ${configFilePath}`);
|
|
82
|
+
}
|
|
83
|
+
workspaceConfig = (0, planMethods_1.readYamlFileAsJson)(configFilePath);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
workspaceConfig = getWorkspaceConfig(normalizedInput, unfilteredFlowFiles);
|
|
87
|
+
}
|
|
78
88
|
if (workspaceConfig.flows) {
|
|
79
89
|
const globs = workspaceConfig.flows.map((glob) => glob);
|
|
80
90
|
const matchedFiles = await (0, glob_1.glob)(globs, {
|
|
@@ -84,12 +94,16 @@ async function plan(input, includeTags, excludeTags, excludeFlows) {
|
|
|
84
94
|
// overwrite the list of files with the globbed ones
|
|
85
95
|
unfilteredFlowFiles = matchedFiles
|
|
86
96
|
.filter((file) => file !== 'config.yaml' &&
|
|
97
|
+
file !== 'config.yml' &&
|
|
98
|
+
(!configFile || file !== path.basename(configFile)) &&
|
|
87
99
|
(file.endsWith('.yaml') || file.endsWith('.yml')))
|
|
88
100
|
.map((file) => path.resolve(normalizedInput, file));
|
|
89
101
|
}
|
|
90
102
|
else {
|
|
91
103
|
// workspace config has no flows, so we need to remove the config file from the test list
|
|
92
|
-
unfilteredFlowFiles = unfilteredFlowFiles.filter((file) => !file.endsWith('config.yaml') &&
|
|
104
|
+
unfilteredFlowFiles = unfilteredFlowFiles.filter((file) => !file.endsWith('config.yaml') &&
|
|
105
|
+
!file.endsWith('config.yml') &&
|
|
106
|
+
(!configFile || !file.endsWith(configFile)));
|
|
93
107
|
}
|
|
94
108
|
if (unfilteredFlowFiles.length === 0) {
|
|
95
109
|
const error = workspaceConfig.flows
|
package/oclif.manifest.json
CHANGED
|
@@ -71,6 +71,12 @@
|
|
|
71
71
|
],
|
|
72
72
|
"type": "option"
|
|
73
73
|
},
|
|
74
|
+
"skip-chrome-onboarding": {
|
|
75
|
+
"description": "[Android only] Skip Chrome browser onboarding screens when running tests",
|
|
76
|
+
"name": "skip-chrome-onboarding",
|
|
77
|
+
"allowNo": false,
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
},
|
|
74
80
|
"apiKey": {
|
|
75
81
|
"aliases": [
|
|
76
82
|
"api-key"
|
|
@@ -120,6 +126,13 @@
|
|
|
120
126
|
"allowNo": false,
|
|
121
127
|
"type": "boolean"
|
|
122
128
|
},
|
|
129
|
+
"config": {
|
|
130
|
+
"description": "Path to custom config.yaml file. If not provided, defaults to config.yaml in root flows folders.",
|
|
131
|
+
"name": "config",
|
|
132
|
+
"hasDynamicHelp": false,
|
|
133
|
+
"multiple": false,
|
|
134
|
+
"type": "option"
|
|
135
|
+
},
|
|
123
136
|
"device-locale": {
|
|
124
137
|
"description": "Locale that will be set to a device, ISO-639-1 code and uppercase ISO-3166-1 code e.g. \"de_DE\" for Germany",
|
|
125
138
|
"name": "device-locale",
|
|
@@ -310,14 +323,15 @@
|
|
|
310
323
|
"type": "option"
|
|
311
324
|
},
|
|
312
325
|
"runner-type": {
|
|
313
|
-
"description": "[
|
|
326
|
+
"description": "[experimental] The type of runner to use - note: anything other than default will incur premium pricing tiers, see https://docs.devicecloud.dev/reference/runner-type for more information",
|
|
314
327
|
"name": "runner-type",
|
|
315
328
|
"default": "default",
|
|
316
329
|
"hasDynamicHelp": false,
|
|
317
330
|
"multiple": false,
|
|
318
331
|
"options": [
|
|
319
332
|
"default",
|
|
320
|
-
"m4"
|
|
333
|
+
"m4",
|
|
334
|
+
"m1"
|
|
321
335
|
],
|
|
322
336
|
"type": "option"
|
|
323
337
|
},
|
|
@@ -493,5 +507,5 @@
|
|
|
493
507
|
]
|
|
494
508
|
}
|
|
495
509
|
},
|
|
496
|
-
"version": "3.
|
|
510
|
+
"version": "3.6.2"
|
|
497
511
|
}
|
package/package.json
CHANGED
|
@@ -71,16 +71,15 @@
|
|
|
71
71
|
"scripts": {
|
|
72
72
|
"dcd": "./bin/dev.js",
|
|
73
73
|
"prod": "./bin/run.js",
|
|
74
|
-
"build": "shx rm -rf dist && tsc -b",
|
|
74
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
75
75
|
"lint": "eslint . --ext .ts",
|
|
76
76
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
77
77
|
"posttest": "yarn lint",
|
|
78
78
|
"prepack": "yarn build && oclif manifest",
|
|
79
79
|
"prepare": "yarn build",
|
|
80
|
-
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
81
80
|
"version": "oclif readme && git add README.md"
|
|
82
81
|
},
|
|
83
|
-
"version": "3.
|
|
82
|
+
"version": "3.6.2",
|
|
84
83
|
"bugs": {
|
|
85
84
|
"url": "https://discord.gg/gm3mJwcNw8"
|
|
86
85
|
},
|