Skip to content

Commit 23840d0

Browse files
finalerock44finalerock44
authored andcommitted
feat: add missing CLI flags to bring GHA to full feature parity
Adds 9 inputs missing from the action (app-url, show-crosshairs, dry-run, metadata, json, json-file-name, allure-path, html-path, artifacts-path), fixes report to support allure/html-detailed, and makes quiet respect the input value instead of being hardcoded on.
1 parent a7d18d3 commit 23840d0

4 files changed

Lines changed: 125 additions & 12 deletions

File tree

action.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ inputs:
7878
description: '[Android only] The orientation of the device to run your flow against in degrees <options: 0|90|180|270>'
7979
required: false
8080
quiet:
81-
description: 'Quieter console output that wont provide progress updates'
81+
description: 'Quieter console output that wont provide progress updates. Defaults to true in CI.'
8282
required: false
83+
default: 'true'
8384
report:
84-
description: 'Runs Maestro with the --format flag, this will generate a report in the specified format <options: junit|html|html-detailed>'
85+
description: 'Runs Maestro with the --format flag, this will generate a report in the specified format <options: junit|html|html-detailed|allure>'
8586
required: false
8687
retry:
8788
description: 'Number of times to retry the run if it fails (same as pressing retry in the UI, this is free)'
@@ -116,6 +117,33 @@ inputs:
116117
description: 'Automatically attach GitHub/PR context (branch, SHA, PR number, PR URL, run ID, repo) to the test run as metadata. Set to "false" to opt out.'
117118
required: false
118119
default: 'true'
120+
app-url:
121+
description: 'Signed URL to an Expo iOS build (.tar.gz). The archive is downloaded and extracted automatically. Expo signed URLs expire after ~1 hour.'
122+
required: false
123+
show-crosshairs:
124+
description: '[Android only] Display crosshairs for screen interactions during test execution'
125+
required: false
126+
dry-run:
127+
description: 'Simulate the run without actually triggering the upload/test, useful for debugging workflow issues'
128+
required: false
129+
metadata:
130+
description: 'One or more key=value metadata pairs to attach to the run (one per line, e.g. MY_KEY=my_value)'
131+
required: false
132+
json:
133+
description: 'Output results in JSON format. Note: will always provide exit code 0'
134+
required: false
135+
json-file-name:
136+
description: 'Custom name for the JSON output file (can include relative path). Requires json-file: true.'
137+
required: false
138+
allure-path:
139+
description: 'Custom file path for downloaded Allure report (requires report: allure, default: ./report.html)'
140+
required: false
141+
html-path:
142+
description: 'Custom file path for downloaded HTML report (requires report: html, default: ./report.html)'
143+
required: false
144+
artifacts-path:
145+
description: 'Custom file path for downloaded artifacts zip (default: ./artifacts.zip)'
146+
required: false
119147

120148
outputs:
121149
DEVICE_CLOUD_CONSOLE_URL:

dist/index.js

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31602,7 +31602,7 @@ const getLatestDcdVersion = (...args_1) => __awaiter(void 0, [...args_1], void 0
3160231602
const run = () => __awaiter(void 0, void 0, void 0, function* () {
3160331603
var _a;
3160431604
try {
31605-
const { additionalAppBinaryIds, additionalAppFiles, androidApiLevel, androidDevice, apiKey, apiUrl, appBinaryId, appFilePath, async, config, deviceLocale, downloadArtifacts, env, excludeFlows, excludeTags, googlePlay, ignoreShaCheck, includeTags, iOSVersion, iosDevice, jsonFile, maestroVersion, name, orientation, report, retry, workspaceFolder, runnerType, debug, moropoV1ApiKey, useBeta, maestroChromeOnboarding, androidNoSnapshot, disableAnimations, githubContext, } = yield (0, params_1.getParameters)();
31605+
const { additionalAppBinaryIds, additionalAppFiles, androidApiLevel, androidDevice, apiKey, apiUrl, appBinaryId, appFilePath, appUrl, async, config, deviceLocale, downloadArtifacts, env, excludeFlows, excludeTags, googlePlay, ignoreShaCheck, includeTags, iOSVersion, iosDevice, jsonFile, jsonFileName, json, maestroVersion, name, orientation, report, retry, workspaceFolder, runnerType, debug, quiet, moropoV1ApiKey, useBeta, maestroChromeOnboarding, androidNoSnapshot, disableAnimations, showCrosshairs, dryRun, userMetadata, allurePath, htmlPath, artifactsPath, githubContext, } = yield (0, params_1.getParameters)();
3160631606
const REMOVED_MAESTRO_VERSIONS = ['1.39.2', '1.39.7', '2.0.3'];
3160731607
if (maestroVersion && REMOVED_MAESTRO_VERSIONS.includes(maestroVersion)) {
3160831608
(0, core_1.setFailed)(`Maestro version ${maestroVersion} is no longer supported. ` +
@@ -31619,6 +31619,7 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
3161931619
'api-url': apiUrl,
3162031620
'app-binary-id': appBinaryId,
3162131621
'app-file': appFilePath,
31622+
'app-url': appUrl,
3162231623
async,
3162331624
config,
3162431625
'device-locale': deviceLocale,
@@ -31637,12 +31638,20 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
3163731638
report,
3163831639
retry,
3163931640
'runner-type': runnerType,
31641+
json,
3164031642
'json-file': jsonFile,
31643+
'json-file-name': jsonFileName,
3164131644
debug,
31645+
quiet,
3164231646
'moropo-v1-api-key': moropoV1ApiKey,
3164331647
'maestro-chrome-onboarding': maestroChromeOnboarding,
3164431648
'android-no-snapshot': androidNoSnapshot,
3164531649
'disable-animations': disableAnimations,
31650+
'show-crosshairs': showCrosshairs,
31651+
'dry-run': dryRun,
31652+
'allure-path': allurePath,
31653+
'html-path': htmlPath,
31654+
'artifacts-path': artifactsPath,
3164631655
};
3164731656
let paramsString = Object.keys(params).reduce((acc, key) => {
3164831657
if (!params[key])
@@ -31663,6 +31672,11 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
3166331672
paramsString += ` --env ${key}=${escapeShellValue(value)}`;
3166431673
});
3166531674
}
31675+
if (userMetadata && userMetadata.length > 0) {
31676+
userMetadata.forEach((pair) => {
31677+
paramsString += ` --metadata ${escapeShellValue(pair)}`;
31678+
});
31679+
}
3166631680
if (githubContext && githubContext.length > 0) {
3166731681
githubContext.forEach((pair) => {
3166831682
paramsString += ` --metadata ${escapeShellValue(pair)}`;
@@ -31672,7 +31686,7 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
3167231686
let uploadId = null;
3167331687
let testOutput = '';
3167431688
try {
31675-
const { output, exitCode } = yield executeCommand(`npx --yes "${dcdVersionString}" cloud ${paramsString} --quiet`);
31689+
const { output, exitCode } = yield executeCommand(`npx --yes "${dcdVersionString}" cloud ${paramsString}`);
3167631690
testOutput = output;
3167731691
if (exitCode === 1) {
3167831692
throw new Error('DeviceCloud CLI failed to run - check your parameters or contact support');
@@ -31891,9 +31905,6 @@ function getParameters() {
3189131905
const orientation = parseOrientation(core.getInput('orientation', { required: false }));
3189231906
const ignoreShaCheck = core.getInput('ignore-sha-check', { required: false }) === 'true';
3189331907
const report = core.getInput('report', { required: false });
31894-
if (report && report !== 'junit' && report !== 'html') {
31895-
throw new Error('Report format must be either "junit" or "html"');
31896-
}
3189731908
const config = core.getInput('config', { required: false });
3189831909
const runnerType = core.getInput('runner-type', { required: false });
3189931910
const jsonFile = core.getInput('json-file', { required: false }) === 'true';
@@ -31907,6 +31918,16 @@ function getParameters() {
3190731918
const maestroChromeOnboarding = core.getInput('maestro-chrome-onboarding', { required: false }) === 'true';
3190831919
const androidNoSnapshot = core.getInput('android-no-snapshot', { required: false }) === 'true';
3190931920
const disableAnimations = core.getInput('disable-animations', { required: false }) === 'true';
31921+
const showCrosshairs = core.getInput('show-crosshairs', { required: false }) === 'true';
31922+
const dryRun = core.getInput('dry-run', { required: false }) === 'true';
31923+
const appUrl = core.getInput('app-url', { required: false }) || undefined;
31924+
const userMetadata = core.getMultilineInput('metadata', { required: false });
31925+
const json = core.getInput('json', { required: false }) === 'true';
31926+
const jsonFileName = core.getInput('json-file-name', { required: false }) || undefined;
31927+
const allurePath = core.getInput('allure-path', { required: false }) || undefined;
31928+
const htmlPath = core.getInput('html-path', { required: false }) || undefined;
31929+
const artifactsPath = core.getInput('artifacts-path', { required: false }) || undefined;
31930+
const quiet = core.getInput('quiet', { required: false }) !== 'false';
3191031931
if (!(appFilePath !== '') !== (appBinaryId !== '')) {
3191131932
throw new Error('Either app-file or app-binary-id must be used');
3191231933
}
@@ -31918,6 +31939,7 @@ function getParameters() {
3191831939
apiUrl,
3191931940
apiKey,
3192031941
appFilePath,
31942+
appUrl,
3192131943
workspaceFolder,
3192231944
env,
3192331945
async,
@@ -31943,12 +31965,21 @@ function getParameters() {
3194331965
config,
3194431966
runnerType,
3194531967
jsonFile,
31968+
jsonFileName,
31969+
json,
3194631970
debug,
31971+
quiet,
3194731972
moropoV1ApiKey,
3194831973
useBeta,
3194931974
maestroChromeOnboarding,
3195031975
androidNoSnapshot,
3195131976
disableAnimations,
31977+
showCrosshairs,
31978+
dryRun,
31979+
userMetadata,
31980+
allurePath,
31981+
htmlPath,
31982+
artifactsPath,
3195231983
githubContext,
3195331984
};
3195431985
});

src/index.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ const run = async (): Promise<void> => {
130130
apiUrl,
131131
appBinaryId,
132132
appFilePath,
133+
appUrl,
133134
async,
134135
config,
135136
deviceLocale,
@@ -143,6 +144,8 @@ const run = async (): Promise<void> => {
143144
iOSVersion,
144145
iosDevice,
145146
jsonFile,
147+
jsonFileName,
148+
json,
146149
maestroVersion,
147150
name,
148151
orientation,
@@ -151,11 +154,18 @@ const run = async (): Promise<void> => {
151154
workspaceFolder,
152155
runnerType,
153156
debug,
157+
quiet,
154158
moropoV1ApiKey,
155159
useBeta,
156160
maestroChromeOnboarding,
157161
androidNoSnapshot,
158162
disableAnimations,
163+
showCrosshairs,
164+
dryRun,
165+
userMetadata,
166+
allurePath,
167+
htmlPath,
168+
artifactsPath,
159169
githubContext,
160170
} = await getParameters();
161171

@@ -179,6 +189,7 @@ const run = async (): Promise<void> => {
179189
'api-url': apiUrl,
180190
'app-binary-id': appBinaryId,
181191
'app-file': appFilePath,
192+
'app-url': appUrl,
182193
async,
183194
config,
184195
'device-locale': deviceLocale,
@@ -197,12 +208,20 @@ const run = async (): Promise<void> => {
197208
report,
198209
retry,
199210
'runner-type': runnerType,
211+
json,
200212
'json-file': jsonFile,
213+
'json-file-name': jsonFileName,
201214
debug,
215+
quiet,
202216
'moropo-v1-api-key': moropoV1ApiKey,
203217
'maestro-chrome-onboarding': maestroChromeOnboarding,
204218
'android-no-snapshot': androidNoSnapshot,
205219
'disable-animations': disableAnimations,
220+
'show-crosshairs': showCrosshairs,
221+
'dry-run': dryRun,
222+
'allure-path': allurePath,
223+
'html-path': htmlPath,
224+
'artifacts-path': artifactsPath,
206225
};
207226

208227
let paramsString = Object.keys(params).reduce((acc, key) => {
@@ -226,6 +245,12 @@ const run = async (): Promise<void> => {
226245
});
227246
}
228247

248+
if (userMetadata && userMetadata.length > 0) {
249+
userMetadata.forEach((pair) => {
250+
paramsString += ` --metadata ${escapeShellValue(pair)}`;
251+
});
252+
}
253+
229254
if (githubContext && githubContext.length > 0) {
230255
githubContext.forEach((pair) => {
231256
paramsString += ` --metadata ${escapeShellValue(pair)}`;
@@ -238,7 +263,7 @@ const run = async (): Promise<void> => {
238263

239264
try {
240265
const { output, exitCode } = await executeCommand(
241-
`npx --yes "${dcdVersionString}" cloud ${paramsString} --quiet`
266+
`npx --yes "${dcdVersionString}" cloud ${paramsString}`
242267
);
243268
testOutput = output;
244269

src/methods/params.ts

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type Params = {
55
apiKey: string;
66
apiUrl: string;
77
appFilePath: string;
8+
appUrl?: string;
89
workspaceFolder: string | null;
910
env?: string[];
1011
async?: boolean;
@@ -26,16 +27,25 @@ export type Params = {
2627
orientation?: 0 | 90 | 180 | 270;
2728
retry?: number;
2829
ignoreShaCheck?: boolean;
29-
report?: 'junit' | 'html';
30+
report?: 'junit' | 'html' | 'html-detailed' | 'allure';
3031
config?: string;
3132
runnerType?: string;
3233
jsonFile?: boolean;
34+
jsonFileName?: string;
35+
json?: boolean;
3336
debug?: boolean;
37+
quiet?: boolean;
3438
moropoV1ApiKey?: string;
3539
useBeta?: boolean;
3640
maestroChromeOnboarding?: boolean;
3741
androidNoSnapshot?: boolean;
3842
disableAnimations?: boolean;
43+
showCrosshairs?: boolean;
44+
dryRun?: boolean;
45+
userMetadata?: string[];
46+
allurePath?: string;
47+
htmlPath?: string;
48+
artifactsPath?: string;
3949
githubContext?: string[];
4050
};
4151

@@ -196,10 +206,9 @@ export async function getParameters(): Promise<Params> {
196206
const report = core.getInput('report', { required: false }) as
197207
| 'junit'
198208
| 'html'
209+
| 'html-detailed'
210+
| 'allure'
199211
| undefined;
200-
if (report && report !== 'junit' && report !== 'html') {
201-
throw new Error('Report format must be either "junit" or "html"');
202-
}
203212

204213
const config = core.getInput('config', { required: false });
205214
const runnerType = core.getInput('runner-type', { required: false });
@@ -217,6 +226,16 @@ export async function getParameters(): Promise<Params> {
217226
const maestroChromeOnboarding = core.getInput('maestro-chrome-onboarding', { required: false }) === 'true';
218227
const androidNoSnapshot = core.getInput('android-no-snapshot', { required: false }) === 'true';
219228
const disableAnimations = core.getInput('disable-animations', { required: false }) === 'true';
229+
const showCrosshairs = core.getInput('show-crosshairs', { required: false }) === 'true';
230+
const dryRun = core.getInput('dry-run', { required: false }) === 'true';
231+
const appUrl = core.getInput('app-url', { required: false }) || undefined;
232+
const userMetadata = core.getMultilineInput('metadata', { required: false });
233+
const json = core.getInput('json', { required: false }) === 'true';
234+
const jsonFileName = core.getInput('json-file-name', { required: false }) || undefined;
235+
const allurePath = core.getInput('allure-path', { required: false }) || undefined;
236+
const htmlPath = core.getInput('html-path', { required: false }) || undefined;
237+
const artifactsPath = core.getInput('artifacts-path', { required: false }) || undefined;
238+
const quiet = core.getInput('quiet', { required: false }) !== 'false';
220239

221240
if (!(appFilePath !== '') !== (appBinaryId !== '')) {
222241
throw new Error('Either app-file or app-binary-id must be used');
@@ -234,6 +253,7 @@ export async function getParameters(): Promise<Params> {
234253
apiUrl,
235254
apiKey,
236255
appFilePath,
256+
appUrl,
237257
workspaceFolder,
238258
env,
239259
async,
@@ -259,12 +279,21 @@ export async function getParameters(): Promise<Params> {
259279
config,
260280
runnerType,
261281
jsonFile,
282+
jsonFileName,
283+
json,
262284
debug,
285+
quiet,
263286
moropoV1ApiKey,
264287
useBeta,
265288
maestroChromeOnboarding,
266289
androidNoSnapshot,
267290
disableAnimations,
291+
showCrosshairs,
292+
dryRun,
293+
userMetadata,
294+
allurePath,
295+
htmlPath,
296+
artifactsPath,
268297
githubContext,
269298
};
270299
}

0 commit comments

Comments
 (0)