fix(qa): 修页面还原对比 harness(Mac死路径 + file://token崩)+ 全量28页跑通

当年只对了 account/team 两页就卡住,真因两个:
- compare-all.mjs designRoot 写死成原开发者 Mac 路径 → 本机找不到 HTML 稿,改 repoRoot 自适配
- compare-page.mjs preparePage 对 file:// 设计稿也注入 token(file:// origin=null)→ 崩,
  限定 token 只对 http 目标注入(登录后页面如 dashboard 当年对不了的根因)

全量 28 页 pixelmatch:22 优秀(<2%)+ 3 良好(2-5%);3 个大 diff 均为有意偏离
(login/register 认证去邮箱)或真实数据(dashboard 修正后 6.38%),非回归。
+ _shot-extract-flow.mjs:提取新流程无头走查脚本。

报告:docs/todo/页面还原-截图对比收尾-2026-06-19.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
seaislee1209
2026-06-19 18:52:21 +08:00
co-authored by Claude Opus 4.8
parent 69163a8f7f
commit 352f99d479
4 changed files with 99 additions and 4 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(here, "../../..");
const designRoot = "file:///Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/电商AI平台";
const targetRoot = "http://127.0.0.1:5173/exact";
const designRoot = `file:///${path.resolve(repoRoot, "电商AI平台").replace(/\\/g, "/")}`;
const targetRoot = process.env.TARGET_ROOT || "http://127.0.0.1:5173/exact";
const manifest = JSON.parse(fs.readFileSync(path.join(here, "pages.json"), "utf8"));
function arg(name, fallback = "") {