mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-12-06 00:15:42 -08:00
Report any failed request and the Notebook status line when the frame page test times out
AI Assisted
This commit is contained in:
1 parent
280d7ebcb1
commit
beca6e62da
1 file changed
+9
-3
@@ -56,7 +56,9 @@ test("under the frame's prefix, with no cookie, the dashboard draws, its stream
|
|||||||
page.on("response", (r) => {
|
page.on("response", (r) => {
|
||||||
const u = new URL(r.url());
|
const u = new URL(r.url());
|
||||||
if (u.origin !== signIn.origin) return;
|
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;
|
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,
|
null,
|
||||||
{ timeout: 15000 }
|
{ 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");
|
await page.click("#notepad-close");
|
||||||
|
|
||||||
// User Preferences: a change of theme is saved to the server.
|
// 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;
|
return n === refused.length + left.length;
|
||||||
}, 5000);
|
}, 5000);
|
||||||
assert.deepEqual(left, [], "every request stays under the prefix");
|
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");
|
assert.deepEqual(errors, [], "no error on the page");
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user