Skip to content

Commit e23f417

Browse files
authored
Merge pull request #159 from Lykhoyda/fix/gh-105-mttr-experiment
fix(gh-105): MTTR experiment surfaces & fixes maestro-error-parser regression
2 parents 0b13dd3 + 902b7d3 commit e23f417

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

scripts/cdp-bridge/dist/domain/maestro-error-parser.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
// raw output text, no I/O, fully unit-testable.
77
//
88
// 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):
1010
//
1111
// - "Element with id 'X' not found"
1212
// - "Element with text 'X' not found"
1313
// - 'Assertion failed: "X" not visible'
1414
// - "Timed out waiting for element 'X'"
1515
// - "Element 'X' is not visible" (assertion variant)
16+
// - "Element not found: id='X'" (maestro-runner 1.0.x shape — issue #105)
1617
//
1718
// The parser tries each known shape in order and returns the first
1819
// match. If none match, returns `{ kind: 'UNKNOWN', raw }` so the caller
@@ -40,6 +41,16 @@ const PATTERNS = [
4041
re: /Element with text (['"])((?:(?!\1).)+)\1 (?:was )?not found/i,
4142
build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'text', selector: m[2], raw }),
4243
},
44+
// maestro-runner 1.0.x shape — issue #105.
45+
// "Element not found: id='X'" or "Element not found: text='X'".
46+
{
47+
re: /Element not found:\s*id=(['"])((?:(?!\1).)+)\1/i,
48+
build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'id', selector: m[2], raw }),
49+
},
50+
{
51+
re: /Element not found:\s*text=(['"])((?:(?!\1).)+)\1/i,
52+
build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'text', selector: m[2], raw }),
53+
},
4354
{
4455
re: /Element (['"])((?:(?!\1).)+)\1 (?:was )?not found/i,
4556
build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'unknown', selector: m[2], raw }),

scripts/cdp-bridge/src/domain/maestro-error-parser.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
// raw output text, no I/O, fully unit-testable.
77
//
88
// 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):
1010
//
1111
// - "Element with id 'X' not found"
1212
// - "Element with text 'X' not found"
1313
// - 'Assertion failed: "X" not visible'
1414
// - "Timed out waiting for element 'X'"
1515
// - "Element 'X' is not visible" (assertion variant)
16+
// - "Element not found: id='X'" (maestro-runner 1.0.x shape — issue #105)
1617
//
1718
// The parser tries each known shape in order and returns the first
1819
// match. If none match, returns `{ kind: 'UNKNOWN', raw }` so the caller
@@ -52,6 +53,16 @@ const PATTERNS: Pattern[] = [
5253
re: /Element with text (['"])((?:(?!\1).)+)\1 (?:was )?not found/i,
5354
build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'text', selector: m[2], raw }),
5455
},
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+
},
5566
{
5667
re: /Element (['"])((?:(?!\1).)+)\1 (?:was )?not found/i,
5768
build: (m, raw) => ({ kind: 'SELECTOR_NOT_FOUND', selectorKind: 'unknown', selector: m[2], raw }),

0 commit comments

Comments
 (0)