|
6 | 6 | // raw output text, no I/O, fully unit-testable. |
7 | 7 | // |
8 | 8 | // Maestro emits failures in a few canonical shapes (verified against |
9 | | -// Maestro 1.40+ output and maestro-runner 0.x): |
| 9 | +// Maestro 1.40+ output, maestro-runner 0.x, and maestro-runner 1.0.9): |
10 | 10 | // |
11 | 11 | // - "Element with id 'X' not found" |
12 | 12 | // - "Element with text 'X' not found" |
13 | 13 | // - 'Assertion failed: "X" not visible' |
14 | 14 | // - "Timed out waiting for element 'X'" |
15 | 15 | // - "Element 'X' is not visible" (assertion variant) |
| 16 | +// - "Element not found: id='X'" (maestro-runner 1.0.x shape — issue #105) |
16 | 17 | // |
17 | 18 | // The parser tries each known shape in order and returns the first |
18 | 19 | // match. If none match, returns `{ kind: 'UNKNOWN', raw }` so the caller |
@@ -52,6 +53,16 @@ const PATTERNS: Pattern[] = [ |
52 | 53 | re: /Element with text (['"])((?:(?!\1).)+)\1 (?:was )?not found/i, |
53 | 54 | build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'text', selector: m[2], raw }), |
54 | 55 | }, |
| 56 | + // maestro-runner 1.0.x shape — issue #105. |
| 57 | + // "Element not found: id='X'" or "Element not found: text='X'". |
| 58 | + { |
| 59 | + re: /Element not found:\s*id=(['"])((?:(?!\1).)+)\1/i, |
| 60 | + build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'id', selector: m[2], raw }), |
| 61 | + }, |
| 62 | + { |
| 63 | + re: /Element not found:\s*text=(['"])((?:(?!\1).)+)\1/i, |
| 64 | + build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'text', selector: m[2], raw }), |
| 65 | + }, |
55 | 66 | { |
56 | 67 | re: /Element (['"])((?:(?!\1).)+)\1 (?:was )?not found/i, |
57 | 68 | build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'unknown', selector: m[2], raw }), |
|
0 commit comments