From de454180d918a4ab4522964dd806feefd9de5f92 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 27 May 2026 16:11:05 -0700 Subject: [PATCH] [eric] test: make the gui selftest prove the window actually painted, not just that a png came back --- e2e/mcp/selftest.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/e2e/mcp/selftest.js b/e2e/mcp/selftest.js index f0657eb8..d8f69c4b 100644 --- a/e2e/mcp/selftest.js +++ b/e2e/mcp/selftest.js @@ -41,6 +41,13 @@ async function main() { if (!isImage) throw new Error('screenshot did not return a PNG'); process.stdout.write(`screenshot -> ${shot.content[0].data.length} base64 bytes\n`); + // A PNG of the right size could still be a BLANK window, so prove the renderer + // actually painted: assert the React root mounted children (the real render gate). + const root = await client.callTool({ name: 'eval', arguments: { expression: "document.getElementById('root').childElementCount" } }); + const childCount = Number(root.content?.[0]?.text); + if (!(childCount > 0)) throw new Error(`renderer #root has ${root.content?.[0]?.text} children (blank window, not a real paint)`); + process.stdout.write(`render check -> #root has ${childCount} children\n`); + const log = await client.callTool({ name: 'read_log', arguments: { tailLines: 5 } }); process.stdout.write(`read_log tail:\n${log.content?.[0]?.text}\n`);