From ddca0e61599e3a182ec4f2a14bef1dcc2a082ded Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Sun, 27 Sep 2026 11:39:18 +0800 Subject: [PATCH] test(dashboard): wait for saved answer hydration on first open The standalone answer report renders its heading statically while the saved answer arrives from fetchChatSession. Only the reload path waited for that hydration (#4646b43d4); the first navigation asserted the table immediately after the heading appeared, so a slow mount could fail the shared dashboard-acceptance lane with "The standalone answer lost content". Wait for the hydrated content before asserting it, matching the reload path. Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- examples/personal-workspace-browser/answer-presentation.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/personal-workspace-browser/answer-presentation.mjs b/examples/personal-workspace-browser/answer-presentation.mjs index 1b94232827..560f3dbffa 100644 --- a/examples/personal-workspace-browser/answer-presentation.mjs +++ b/examples/personal-workspace-browser/answer-presentation.mjs @@ -90,6 +90,9 @@ export const answerPresentationScenario = { const originalTurnCount = api.turnRequests.length; await page.goto(reportHref, { waitUntil: "networkidle" }); await page.getByRole("heading", { name: "完整答复" }).waitFor({ state: "visible" }); + // The report heading is static while the saved answer arrives from + // ``fetchChatSession``; wait for hydration before asserting its content. + await page.locator(".answer-report-content table").waitFor({ state: "visible", timeout: 15_000 }); if (await page.locator(".answer-report-content table").count() !== 1 || !(await page.locator(".answer-report-content").innerText()).includes("可回退路径") || await page.locator(".answer-report-content script").count() || await page.evaluate(() => window.pwned === true)) {