From 801f1480349f4b6101a2904615da291aed841c90 Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Sat, 28 Feb 2026 15:22:44 +0100 Subject: [PATCH] fix: enriched visibility tips now reach the error message + reorder expects The 'not visible' tips were on the wrong code path (error:notvisible branch which is rare). Hidden elements go through the missingState branch instead. Fixed by adding visibility tip when missingState === 'visible'. Also moved inline snapshot assertions before isError expects per convention. --- playwright | 2 +- playwriter/src/relay-core.test.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/playwright b/playwright index 502df20..1b5fc0c 160000 --- a/playwright +++ b/playwright @@ -1 +1 @@ -Subproject commit 502df20d7577b20edc760c45a68c18e1b44724b2 +Subproject commit 1b5fc0ce6f4571498a116adca180a9db23bb13cb diff --git a/playwriter/src/relay-core.test.ts b/playwriter/src/relay-core.test.ts index 594174a..fd730cc 100644 --- a/playwriter/src/relay-core.test.ts +++ b/playwriter/src/relay-core.test.ts @@ -1043,11 +1043,11 @@ describe('Relay Core Tests', () => { `, }, }) - expect((result as any).isError).toBe(true) const text = (result as any).content[0].text // Strip stack traces and call logs to only match the descriptive error line const errorLine = text.split('\n').find((l: string) => l.includes('Timeout') || l.includes('not visible') || l.includes('not stable')) - expect(errorLine).toMatchInlineSnapshot(`"Error executing code: page.click: Timeout 2000ms exceeded. Element is not visible"`) + expect(errorLine).toMatchInlineSnapshot(`"Error executing code: page.click: Timeout 2000ms exceeded. Element is not visible — it may be hidden by CSS, inside a collapsed
, inactive tab, or closed accordion. Try: interact with the page to reveal it first, or use { force: true } to skip visibility checks"`) + expect((result as any).isError).toBe(true) // Cleanup await client.callTool({ name: 'execute', arguments: { code: js`await state.errorTestPage.close(); delete state.errorTestPage;` } }) }, 30000) @@ -1075,10 +1075,10 @@ describe('Relay Core Tests', () => { `, }, }) - expect((result as any).isError).toBe(true) const text = (result as any).content[0].text const errorLine = text.split('\n').find((l: string) => l.includes('Timeout') || l.includes('intercepts')) expect(errorLine).toMatchInlineSnapshot(`"Error executing code: page.click: Timeout 2000ms exceeded.
Overlay
intercepts pointer events"`) + expect((result as any).isError).toBe(true) await client.callTool({ name: 'execute', arguments: { code: js`await state.errorTestPage.close(); delete state.errorTestPage;` } }) }, 30000) @@ -1100,10 +1100,10 @@ describe('Relay Core Tests', () => { `, }, }) - expect((result as any).isError).toBe(true) const text = (result as any).content[0].text const errorLine = text.split('\n').find((l: string) => l.includes('Timeout') || l.includes('not visible')) - expect(errorLine).toMatchInlineSnapshot(`"Error executing code: page.click: Timeout 2000ms exceeded. Element is not visible"`) + expect(errorLine).toMatchInlineSnapshot(`"Error executing code: page.click: Timeout 2000ms exceeded. Element is not visible — it may be hidden by CSS, inside a collapsed
, inactive tab, or closed accordion. Try: interact with the page to reveal it first, or use { force: true } to skip visibility checks"`) + expect((result as any).isError).toBe(true) await client.callTool({ name: 'execute', arguments: { code: js`await state.errorTestPage.close(); delete state.errorTestPage;` } }) }, 30000)