diff --git a/apps/web/scripts/smoke.mjs b/apps/web/scripts/smoke.mjs index b37704b6..b1b5452c 100644 --- a/apps/web/scripts/smoke.mjs +++ b/apps/web/scripts/smoke.mjs @@ -275,7 +275,9 @@ async function main() { const t0 = Date.now(); try { await page.goto("about:blank"); - await page.goto(`${BASE}/console/audit?mock=1`, { waitUntil: "networkidle", timeout: 30_000 }); + // 起始页用不跳转的日志页(/console/audit 已并进日志页,会跳到 /console/logs?type=audit 且丢掉 ?mock=1) + await page.goto(`${BASE}/console/logs?type=audit&mock=1`, { waitUntil: "networkidle", timeout: 30_000 }); + const startPath = new URL(page.url()).pathname; const launcher = page.locator("[data-agent-launcher]:visible").last(); await launcher.click(); await page.getByRole("button", { name: "历史会话" }).click(); @@ -288,7 +290,7 @@ async function main() { // 等历史弹层退场后再按 Escape,避免按键被仍在退场的 Popover 消耗。 await list.waitFor({ state: "hidden", timeout: 5_000 }); await page.getByRole("button", { name: "新对话" }).and(page.locator(":enabled")).waitFor({ timeout: 10_000 }); - if (new URL(page.url()).pathname !== "/console/audit") problems.push("点历史会话跳走了页面"); + if (new URL(page.url()).pathname !== startPath) problems.push("点历史会话跳走了页面"); await page.keyboard.press("Escape"); await page.locator('[data-slot="sheet-content"]').waitFor({ state: "hidden", timeout: 5_000 }); await launcher.click();