Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/providers/maestro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2515,8 +2515,18 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
};
});

const base = super.runToJson(run);
return {
...super.runToJson(run),
...base,
// Prefer the device that actually ran over the requested capability:
// a wildcard or partial name like "*" is meaningless in a report.
device: {
name: run.environment?.device || base.device.name,
platform: base.device.platform,
...((run.environment?.version || base.device.version) && {
version: run.environment?.version || base.device.version,
}),
},
passed: this.runPassed(run),
flows: jsonFlows,
};
Expand Down
28 changes: 28 additions & 0 deletions tests/providers/maestro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6741,6 +6741,34 @@ onFlowStart:
expect(run.flows?.[2]).not.toHaveProperty('durationSeconds');
});

it('reports the device that actually ran instead of a wildcard request', () => {
maestro['appId'] = 1234;
const runs = [
{
id: 1,
status: 'DONE',
capabilities: { deviceName: '*', platformName: 'iOS' },
environment: {
device: 'iPhone 13',
name: 'iOS 18.5',
version: '18.5',
},
success: 1,
flows: [],
},
] as unknown as import('../../src/providers/maestro').MaestroRunInfo[];
const json = maestro.toJsonOutput({
success: true,
outcome: 'passed',
runs,
});
expect(json.runs[0].device).toEqual({
name: 'iPhone 13',
platform: 'iOS',
version: '18.5',
});
});

it('marks a run as passed when every latest attempt passed', () => {
maestro['appId'] = 1234;
const runs = [
Expand Down
Loading