@devicecloud.dev/dcd
Version:
Better cloud maestro testing
217 lines (216 loc) • 9.35 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.flags = exports.resolveMaestroVersion = exports.getLatestMaestroVersion = exports.DEFAULT_MAESTRO_VERSION = exports.SUPPORTED_MAESTRO_VERSIONS = void 0;
const core_1 = require("@oclif/core");
const device_types_1 = require("./types/device.types");
// Centralized maestro version definitions - single source of truth
exports.SUPPORTED_MAESTRO_VERSIONS = [
'1.39.0',
'1.39.1',
'1.39.2',
'1.39.4',
'1.39.5',
'1.39.7',
'1.39.13',
'1.40.0',
'1.40.1',
'1.40.2',
'1.40.3',
'1.41.0',
];
exports.DEFAULT_MAESTRO_VERSION = '1.41.0';
const getLatestMaestroVersion = () => exports.SUPPORTED_MAESTRO_VERSIONS.at(-1);
exports.getLatestMaestroVersion = getLatestMaestroVersion;
const resolveMaestroVersion = (version) => {
if (version === 'latest') {
return (0, exports.getLatestMaestroVersion)();
}
return version || exports.DEFAULT_MAESTRO_VERSION;
};
exports.resolveMaestroVersion = resolveMaestroVersion;
exports.flags = {
'additional-app-binary-ids': core_1.Flags.string({
default: [],
description: 'The ID of the additional app binary(s) previously uploaded to devicecloud.dev to install before execution',
multiple: true,
multipleNonGreedy: true,
parse: (input) => input.split(','),
}),
'additional-app-files': core_1.Flags.file({
default: [],
description: 'Additional app binary(s) to install before execution',
multiple: true,
multipleNonGreedy: true,
parse: (input) => input.split(','),
}),
'android-api-level': core_1.Flags.string({
description: '[Android only] Android API level to run your flow against',
options: Object.values(device_types_1.EAndroidApiLevels),
}),
'android-device': core_1.Flags.string({
description: '[Android only] Android device to run your flow against',
options: Object.values(device_types_1.EAndroidDevices),
}),
apiKey: core_1.Flags.string({
aliases: ['api-key'],
description: 'API key for devicecloud.dev (find this in the console UI). You can also set the DEVICE_CLOUD_API_KEY environment variable.',
}),
apiUrl: core_1.Flags.string({
aliases: ['api-url', 'apiURL'],
default: 'https://api.devicecloud.dev',
description: 'API base URL',
hidden: true,
}),
'app-binary-id': core_1.Flags.string({
aliases: ['app-binary-id'],
description: 'The ID of the app binary previously uploaded to devicecloud.dev',
}),
'app-file': core_1.Flags.file({
aliases: ['app-file'],
description: 'App binary to run your flows against',
}),
'artifacts-path': core_1.Flags.string({
dependsOn: ['download-artifacts'],
description: 'Custom file path for downloaded artifacts (default: ./artifacts.zip)',
}),
async: core_1.Flags.boolean({
description: 'Immediately return (exit code 0) from the command without waiting for the results of the run (useful for saving CI minutes)',
}),
config: core_1.Flags.file({
description: 'Path to custom config.yaml file. If not provided, defaults to config.yaml in root flows folders.',
}),
debug: core_1.Flags.boolean({
default: false,
description: 'Enable detailed debug logging for troubleshooting issues',
}),
'device-locale': core_1.Flags.string({
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',
}),
'download-artifacts': core_1.Flags.string({
description: 'Download a zip containing the logs, screenshots and videos for each result in this run. You will debited a $0.01 egress fee for each result. Use --download-artifacts=FAILED for failures only or --download-artifacts=ALL for every result.',
options: ['ALL', 'FAILED'],
}),
'dry-run': core_1.Flags.boolean({
default: false,
description: 'Simulate the run without actually triggering the upload/test, useful for debugging workflow issues.',
}),
env: core_1.Flags.file({
char: 'e',
description: 'One or more environment variables to inject into your flows',
multiple: true,
multipleNonGreedy: true,
}),
'exclude-flows': core_1.Flags.string({
default: [],
description: 'Sub directories to ignore when building the flow file list',
multiple: true,
multipleNonGreedy: true,
parse: (input) => input.split(','),
}),
'exclude-tags': core_1.Flags.string({
aliases: ['exclude-tags'],
default: [],
description: 'Flows which have these tags will be excluded from the run',
multiple: true,
multipleNonGreedy: true,
parse: (input) => input.split(','),
}),
flows: core_1.Flags.string({
description: 'The path to the flow file or folder containing your flows',
}),
'google-play': core_1.Flags.boolean({
aliases: ['google-play'],
default: false,
description: '[Android only] Run your flow against Google Play devices',
}),
'ignore-sha-check': core_1.Flags.boolean({
description: 'Ignore the sha hash check and upload the binary regardless of whether it already exists (not recommended)',
}),
'include-tags': core_1.Flags.string({
aliases: ['include-tags'],
default: [],
description: 'Only flows which have these tags will be included in the run',
multiple: true,
multipleNonGreedy: true,
parse: (input) => input.split(','),
}),
'ios-device': core_1.Flags.string({
description: '[iOS only] iOS device to run your flow against',
options: Object.values(device_types_1.EiOSDevices),
}),
'ios-version': core_1.Flags.string({
description: '[iOS only] iOS version to run your flow against',
options: Object.values(device_types_1.EiOSVersions),
}),
json: core_1.Flags.boolean({
description: 'Output results in JSON format - note: will always provide exit code 0',
}),
'json-file': core_1.Flags.boolean({
description: 'Write JSON output to a file. File be called <upload_id>_dcd.json unless you supply the --json-file-name flag - note: will always exit with code 0',
required: false,
}),
'json-file-name': core_1.Flags.string({
description: 'A custom name for the JSON file (can also include relative path)',
dependsOn: ['json-file'],
}),
'maestro-version': core_1.Flags.string({
aliases: ['maestroVersion'],
default: exports.DEFAULT_MAESTRO_VERSION,
description: 'Maestro version to run your flow against',
options: [...exports.SUPPORTED_MAESTRO_VERSIONS, 'latest'],
}),
metadata: core_1.Flags.string({
char: 'm',
description: 'Arbitrary key-value metadata to include with your test run (format: key=value)',
multiple: true,
multipleNonGreedy: true,
}),
mitmHost: core_1.Flags.string({
description: 'used for mitmproxy support, enterprise only, contact support if interested',
}),
mitmPath: core_1.Flags.string({
dependsOn: ['mitmHost'],
description: 'used for mitmproxy support, enterprise only, contact support if interested',
}),
'moropo-v1-api-key': core_1.Flags.string({
description: 'API key for Moropo v1 integration',
required: false,
}),
name: core_1.Flags.string({
description: 'A custom name for your upload (useful for tagging commits etc)',
}),
orientation: core_1.Flags.string({
description: '[Android only] The orientation of the device to run your flow against in degrees',
options: ['0', '90', '180', '270'],
}),
quiet: core_1.Flags.boolean({
char: 'q',
default: false,
description: 'Quieter console output that wont provide progress updates',
}),
report: core_1.Flags.string({
aliases: ['format'],
description: 'Runs Maestro with the --format flag, this will generate a report in the specified format',
options: ['junit', 'html'],
}),
retry: core_1.Flags.integer({
description: 'Automatically retry the run up to the number of times specified (same as pressing retry in the UI) - this is free of charge',
}),
'runner-type': core_1.Flags.string({
default: 'default',
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',
options: ['default', 'm4', 'm1'],
}),
'show-crosshairs': core_1.Flags.boolean({
default: false,
description: '[Android only] Display crosshairs for screen interactions during test execution',
}),
'skip-chrome-onboarding': core_1.Flags.boolean({
default: false,
description: '[Android only] Skip Chrome browser onboarding screens when running tests',
}),
'x86-arch': core_1.Flags.boolean({
default: false,
description: '[iOS only, experimental] Run your flow against x86 architecture simulator instead of arm64',
}),
};