test: list each failed step of an ios flow with its error from maestro 2's command log

This commit is contained in:
Linus Rath
2026-11-03 01:42:52 +01:00
parent a3e3ae9ee1
commit ab7e0b90d4
+4 -2
View File
@@ -43,14 +43,16 @@ function findHierarchy(obj, seen = new Set()) {
return null;
}
for (const file of walkFiles(root).filter((f) => /commands-.*\.json$/.test(f))) {
// Maestro 1 writes commands-<flow>.json, Maestro 2 <flow>/commands.json.
for (const file of walkFiles(root).filter((f) => /(^|[\\/])commands(-[^\\/]*)?\.json$/.test(f))) {
let data;
try {
data = JSON.parse(fs.readFileSync(file, 'utf8'));
} catch {
continue;
}
out.push(`== ${path.basename(file)}`);
const base = path.basename(file);
out.push(`== ${base === 'commands.json' ? `${path.basename(path.dirname(file))} / ${base}` : base}`);
for (const entry of Array.isArray(data) ? data : []) {
const command = entry.command || {};
const type = Object.keys(command).find((k) => command[k]) || '?';