fix: recover mouse fallback actionability errors

This commit is contained in:
Pradeep Elankumaran
2026-09-08 22:37:25 -07:00
parent 5cdb83d262
commit cba6cd27f2
2 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -92,7 +92,8 @@ export function isInvalidSelectorError(err) {
export function isElementInteractionError(err) {
if (err?.code === 'element_not_actionable') return true;
const msg = err && err.message || '';
return msg.includes('not visible') ||
return msg.includes('Element not actionable') ||
msg.includes('not visible') ||
msg.includes('Malformed value') ||
msg.includes('not an <input>') ||
msg.includes('Input of type "submit" cannot be filled') ||
+14
View File
@@ -81,6 +81,20 @@ describe('browser error normalization', () => {
expect(browserErrorCode(err)).toBe('element_not_actionable');
});
test('locator wait timeouts normalize to a fresh-snapshot recovery', () => {
const err = new Error('page.focus: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator(\'select[name="status"]\')');
expect(browserErrorStatus(err)).toBe(422);
expect(browserErrorCode(err)).toBe('element_not_actionable');
expect(browserErrorRecovery(err)).toBe('snapshot_then_retry');
});
test('mouse fallback actionability errors normalize to a fresh-snapshot recovery', () => {
const err = new Error('Element not actionable: mouse fallback did not complete within 3000ms. Call snapshot to refresh refs and retry.');
expect(browserErrorStatus(err)).toBe(422);
expect(browserErrorCode(err)).toBe('element_not_actionable');
expect(browserErrorRecovery(err)).toBe('snapshot_then_retry');
});
test('non-fillable submit inputs normalize to element actionability errors', () => {
const err = Object.assign(
new Error('Element input[type=submit] is not fillable. Use click for buttons and other controls.'),