From 169d9e5e7cc1c6c2d9e77f83de466e20d3214d06 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Oct 2026 19:34:07 +0800 Subject: [PATCH] =?UTF-8?q?test(smoke):=20=E6=99=BA=E8=83=BD=E4=BD=93?= =?UTF-8?q?=E6=8A=BD=E5=B1=89=E5=8E=86=E5=8F=B2=E7=94=A8=E4=BE=8B=E8=B5=B7?= =?UTF-8?q?=E5=A7=8B=E9=A1=B5=E6=94=B9=E7=94=A8=E6=97=A5=E5=BF=97=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /console/audit 已跳转到 /console/logs?type=audit(且丢掉 ?mock=1), 断言路径仍是 /console/audit 必然失败;改从日志页起步,断言打开会话后路径不变。 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei --- apps/web/scripts/smoke.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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();