Skip to content

Commit 82fdfe7

Browse files
detailed html reporting
1 parent 8ca8674 commit 82fdfe7

3 files changed

Lines changed: 30 additions & 21 deletions

File tree

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const maestroCommand = program
339339
// Report options
340340
.option(
341341
'--report <format>',
342-
'Download test report after completion: html or junit.',
342+
'Download test report after completion: html, html-detailed, or junit.',
343343
(val) => val.toLowerCase() as ReportFormat,
344344
)
345345
.option(

src/models/maestro_options.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface MaestroConfig {
99

1010
export type Orientation = 'PORTRAIT' | 'LANDSCAPE';
1111
export type ThrottleNetwork = '4G' | '3G' | 'Edge' | 'airplane' | 'disable';
12-
export type ReportFormat = 'html' | 'junit';
12+
export type ReportFormat = 'html' | 'html-detailed' | 'junit';
1313
export type ArtifactDownloadMode = 'all' | 'failed';
1414

1515
export interface RunMetadata {
@@ -130,7 +130,9 @@ export default class MaestroOptions {
130130
this._tunnel = options?.tunnel ?? false;
131131
this._tunnelIdentifier =
132132
options?.tunnelIdentifier ??
133-
(this._tunnel ? `maestro-testing-${randomUUID().slice(0, 8)}` : undefined);
133+
(this._tunnel
134+
? `maestro-testing-${randomUUID().slice(0, 8)}`
135+
: undefined);
134136
this._quiet = options?.quiet ?? false;
135137
this._async = options?.async ?? false;
136138
this._dryRun = options?.dryRun ?? false;
@@ -319,8 +321,7 @@ export default class MaestroOptions {
319321
if (this._throttleNetwork) caps.throttle_network = this._throttleNetwork;
320322
if (this._geoCountryCode)
321323
caps['testingbot.geoCountryCode'] = this._geoCountryCode;
322-
if (this._tunnelIdentifier)
323-
caps.tunnelIdentifier = this._tunnelIdentifier;
324+
if (this._tunnelIdentifier) caps.tunnelIdentifier = this._tunnelIdentifier;
324325
if (this._realDevice) caps.realDevice = 'true';
325326

326327
return caps;

src/providers/maestro.ts

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
239239
const { allFlowFiles, baseDir } = flowResult;
240240
const effectiveBase =
241241
baseDir || this.computeCommonDirectory(allFlowFiles);
242-
logger.info('Zip structure (files as they will appear in the archive):');
242+
logger.info(
243+
'Zip structure (files as they will appear in the archive):',
244+
);
243245
for (const file of allFlowFiles) {
244246
const archiveName = path.relative(effectiveBase, path.resolve(file));
245247
logger.info(` ${archiveName}`);
@@ -470,10 +472,7 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
470472
if (flowsPaths.length === 1) {
471473
const singlePath = flowsPaths[0];
472474
const stat = await fs.promises.stat(singlePath).catch(() => null);
473-
if (
474-
stat?.isFile() &&
475-
path.extname(singlePath).toLowerCase() === '.zip'
476-
) {
475+
if (stat?.isFile() && path.extname(singlePath).toLowerCase() === '.zip') {
477476
return null;
478477
}
479478
}
@@ -543,9 +542,7 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
543542
baseDir = projectRoot.dir;
544543
// Include config.yaml and discover its dependencies
545544
const configResolved = path.resolve(projectRoot.configPath);
546-
if (
547-
!allFlowFiles.some((f) => path.resolve(f) === configResolved)
548-
) {
545+
if (!allFlowFiles.some((f) => path.resolve(f) === configResolved)) {
549546
allFlowFiles.push(projectRoot.configPath);
550547
}
551548
}
@@ -835,10 +832,7 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
835832
): Promise<{ includeTags?: string[]; excludeTags?: string[] }> {
836833
const candidates = this.options.configFile
837834
? [path.resolve(this.options.configFile)]
838-
: [
839-
path.join(baseDir, 'config.yaml'),
840-
path.join(baseDir, 'config.yml'),
841-
];
835+
: [path.join(baseDir, 'config.yaml'), path.join(baseDir, 'config.yml')];
842836

843837
for (const candidate of candidates) {
844838
try {
@@ -2128,8 +2122,24 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
21282122

21292123
for (const run of runs) {
21302124
try {
2131-
const reportEndpoint =
2132-
reportFormat === 'junit' ? 'junit_report' : 'html_report';
2125+
let reportEndpoint: string;
2126+
let reportKey: string;
2127+
switch (reportFormat) {
2128+
case 'junit':
2129+
reportEndpoint = 'junit_report';
2130+
reportKey = 'junit_report';
2131+
break;
2132+
case 'html-detailed':
2133+
reportEndpoint = 'html_report_detailed';
2134+
reportKey = 'html_report_detailed';
2135+
break;
2136+
case 'html':
2137+
default:
2138+
reportEndpoint = 'html_report';
2139+
reportKey = 'html_report';
2140+
break;
2141+
}
2142+
21332143
const response = await axios.get(
21342144
`${this.URL}/${this.appId}/${run.id}/${reportEndpoint}`,
21352145
{
@@ -2149,8 +2159,6 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
21492159
utils.checkForUpdate(latestVersion);
21502160

21512161
// Extract the report content from the JSON response
2152-
const reportKey =
2153-
reportFormat === 'junit' ? 'junit_report' : 'html_report';
21542162
const reportContent = response.data[reportKey];
21552163

21562164
if (!reportContent) {

0 commit comments

Comments
 (0)