From beca6e62da2f44cc492428488cd0f8a88c3748b0 Mon Sep 17 00:00:00 2001 From: Seth <40871381+sethalan@users.noreply.github.com> Date: Sat, 5 Dec 2026 19:44:53 -0800 Subject: [PATCH] Report any failed request and the Notebook status line when the frame page test times out AI Assisted --- scripts/test-web-console-page-frame.mjs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/test-web-console-page-frame.mjs b/scripts/test-web-console-page-frame.mjs index 8b69219..766a884 100644 --- a/scripts/test-web-console-page-frame.mjs +++ b/scripts/test-web-console-page-frame.mjs @@ -56,7 +56,9 @@ test("under the frame's prefix, with no cookie, the dashboard draws, its stream page.on("response", (r) => { const u = new URL(r.url()); if (u.origin !== signIn.origin) return; - if (r.status() === 403 || r.status() === 404) refused.push(`${r.status()} ${u.pathname}`); + // Any error status, a server error included: a step that waits on a + // failed request then fails with that request named. + if (r.status() >= 400) refused.push(`${r.status()} ${u.pathname}`); if (u.pathname === `${prefix}events` && r.status() === 200) streamed = true; }); @@ -85,7 +87,11 @@ test("under the frame's prefix, with no cookie, the dashboard draws, its stream }, null, { timeout: 15000 } - ); + ).catch(async (e) => { + // Say what the Notebook itself showed: a note it could not read, or none yet. + const status = await page.locator("#notepad-status").textContent().catch(() => ""); + throw new Error(`${e.message}; the Notebook's status line: ${JSON.stringify((status || "").trim())}`); + }); await page.click("#notepad-close"); // User Preferences: a change of theme is saved to the server. @@ -108,7 +114,7 @@ test("under the frame's prefix, with no cookie, the dashboard draws, its stream return n === refused.length + left.length; }, 5000); assert.deepEqual(left, [], "every request stays under the prefix"); - assert.deepEqual(refused, [], "no request is refused or missing"); + assert.deepEqual(refused, [], "no request is refused, missing or failed"); } assert.deepEqual(errors, [], "no error on the page"); });