fix(ui): wait for rendered browser state during CI navigation
Endoleap brand checks / verify (pull_request) Successful in 6s
creative workspace review checks / verify (pull_request) Successful in 26m0s

This commit is contained in:
2026-11-01 03:09:33 +08:00
parent 628449735b
commit 2a324c4d19
5 changed files with 24 additions and 14 deletions
@@ -89,7 +89,8 @@ export async function verifyGuidanceWorkspaceUI(base: string, browser: Browser)
route.fulfill({ json: { document: authored } }),
);
const page = await context.newPage();
page.setDefaultTimeout(10000);
page.setDefaultTimeout(60000);
page.setDefaultNavigationTimeout(60000);
page.on("pageerror", (error) => errors.push(error.message));
page.on("crash", () => errors.push("Browser renderer crashed"));
const pending = new Set<string>(), network: string[] = [];
@@ -99,7 +100,7 @@ export async function verifyGuidanceWorkspaceUI(base: string, browser: Browser)
async function navigate(url: string, reload = false) {
const previousSessionReplies = sessionReplies;
try {
const navigation = await (reload ? page.reload({waitUntil:"domcontentloaded"}) : page.goto(url,{waitUntil:"domcontentloaded"}));
const navigation = await (reload ? page.reload({waitUntil:"commit"}) : page.goto(url,{waitUntil:"commit"}));
assert.ok(navigation?.ok(), "Navigation returns a successful document");
await page.getByText(signedIn ? "editor@example.com" : "登录你的账户",{exact:true}).first().waitFor({state:"attached"});
assert.ok(sessionReplies > previousSessionReplies, "The new document requests its account fixture and renders the resulting account state");