docs(acceptance): 两轮全站验收读数 + 复现脚本 + 企微资产包入库(OPEN-12)
按「这条结论怎么来的必须入库,排查当时的截图只服务当时」的既有口径,
把此前一直悬在 git status 里、归属未定的产物逐组落定:
入库(7.2MB):
- docs/acceptance/2026-10-21-full-qa/、2026-10-24-full-qa/ 的文字与结构化读数
(README / defects*.json / sweep/summary.json / axe evidence / lighthouse /
report.json 逐 run 原始读数 / tools 复现脚本)
- docs/acceptance/2026-11-26-axe/ 本轮 axe 复跑证据(35 路由 × 4 组合 140 rows 全 0)
- scripts/acceptance/{sweep-routes,contact-sheet}.mjs —— 两轮 README 里被引用的
复现脚本,不提交则结论不可复算
- deliverables/.../wecom-pack.cjs + check-wecom.py + WECOM-MANIFEST.md +
assets-wecom/pack-report.json(生成器/校验器/清单;18 张 PNG 可由脚本从已入库
SVG 重新栅格化,故仍按既有规则忽略)
忽略(不提交,已写进 .gitignore 并注明归属):
- 两轮验收的逐页截图(172MB):只在排查当时有用
- infra/cicd/gitea{,-custom}/ + 2026-10-22-gitea-branding/(340KB):
归 feature/gitea-branding,逐文件 sha256 与该分支 50/50 完全一致,
在本分支提交会造成同一批文件的两份历史
判据:提交后 git status -uall 只剩被忽略项;每条 ?? 都能回答「归谁、为什么在这里」。
This commit is contained in:
1 parent
938af25030
commit
763e159ac4
45 files changed
+257540
No files matched your search
@@ -0,0 +1,48 @@
|
||||
# 企业微信资产包 · 清单(第五十二刀)
|
||||
|
||||
生成:`wecom-pack.cjs`(18 张 PNG + `pack-report.json`)
|
||||
门禁:`check-wecom.py` → **判红 0 / 通过 64 / 预期红 2 / EXIT=0**
|
||||
对照页:`wecom.html`(手写件,非生成 —— 所以不配标签配平闸,改由浏览器实验 20 张图 0 破图)
|
||||
|
||||
## 一、两类载体,两套判据
|
||||
|
||||
| 用途 | 文件 | 关键判据(实测,非声明) |
|
||||
|---|---|---|
|
||||
| 企业微信头像·标准 | `wecom-avatar-full-512.png` `…-144.png` | 圆即底板(内切圆外 0 像素);中心 (196,30,58)=朱砂;源 `avatar-standard.svg`,face 0.80 |
|
||||
| 企业微信头像·仪式 | `wecom-avatar-ring2-512.png` `…-144.png` | 同上;粗白环 4.5% + 字面 0.68,源 `avatar-ceremonial.svg` |
|
||||
| 企业logo·名+号 | `wecom-logo-stacked-702x180-{white,transparent,reversed}.png` | 墨 462×180、左右各空 120、居中差 ≤1px;朱砂 0.47%(含红的 A) |
|
||||
| 企业logo·只走名 | `wecom-logo-name-702x180-{white,transparent,reversed}.png` | 墨 702×154、上下各空 13、居中差 0;朱砂恰 0(源不含号 ⇒ 无 A 可加彩) |
|
||||
| 留白备版 | 上两组的 `-pad-` 三件套 | 板内四周内缩 13px 后重装;stacked 墨 395×154、name 墨 676×148 |
|
||||
| @2x 高清备份 | `wecom-logo-{stacked,name}-2x-1404x360-white.png` | 只出白底板;上传框按 702×180 用 |
|
||||
|
||||
## 二、这一刀量出来的三条,推翻了我自己先前的说法
|
||||
|
||||
1. **「方印塞圆裁会咬字」不成立。** 实测两版白字最远极径都在内切圆内:方版余量 10.3%、圆版 8.0%;40px 下逐格差异只有 9.4%。
|
||||
真正的差别是语义 —— 方版被裁后那道圆边是**被裁出来的**,「印是方的」这层意思当场没了;圆版那道圆按 `face ≤ 0.866`(真迹最远极径 0.5773×max)设计。
|
||||
判据 B 因此改述为「圆即底板」,不再宣称保护可读性。
|
||||
2. **字标 SVG 的 viewBox 上下带空盒,按画布排必偏心。** 实测 `public/logo.svg` 墨只占画布高 **72.8%**、`name-alone.svg` 只占 **51.1%**;
|
||||
上一版按画布顶天立地排,门禁当场报出上下差 9–30px。改成**先裁墨盒再定标**后才归零。
|
||||
⚠ 这与记忆里那条「承载尺寸的空盒会污染一切由它换算出来的数」是同一个 bug 的第三次现身(前两次:主锁定 viewBox 写死 460、名墨右 255.6)。
|
||||
3. **`name` 的墨宽高比实测 4.557,比 702×180 的板(3.900)还扁** ⇒ 它只能按宽限死。
|
||||
记忆里「新横排名 2.663」是**画布**比不是**墨**比;`name-alone.svg` 那个 96 单位高的画布是空盒。
|
||||
|
||||
## 三、装配层踩过的三个坑(都靠门禁或实测拦住,没进交付)
|
||||
|
||||
- `assertPurePaths` 把注释里的「现网那份用 `<text>`」判成违规 —— 判据先剥 XML 注释才对。
|
||||
- `sharp.resize(宽, 高)` 参数顺序写反,墨块被排成 180×384,合成时才报「比底板大」。
|
||||
- **负对照的预期红被计进失败数** ⇒ 闸越准、EXIT 越红。已按「退出码分档 + 预期红登记」改掉,并加条数下限(<2 条即宣布负对照没跑成、上面所有 ok 不作数)。
|
||||
|
||||
## 四、两条必须随文件交接的存疑
|
||||
|
||||
1. **702×180 是半核实。** 口径来自转述官方后台提示的二手文(CSDN 教程、建站问答),官方帮助中心正文为 JS 渲染、抓不到正文。
|
||||
上传前以管理后台【我的企业 → 企业信息 → 企业logo】的提示框为准;若比例不同,改 `wecom-pack.cjs` 顶部 `PLATE` 一个常量即可重出全套。
|
||||
2. **没做的部分**:自建应用图标、群机器人头像、对外名片 —— 官方尺寸没有可信来源,不拿猜的数当交付。
|
||||
|
||||
## 五、待拍(对照页第四节)
|
||||
|
||||
- **W1** 头像 full / ring2 → 推荐 **full**(企业微信是最小、压最狠、重复最多的载体,ring2 那道环正是实测会碎成 38 块的那一档)
|
||||
- **W2** 企业logo 名+号 / 只走名 → 推荐 **名+号**(与 2026-10-20「导航必须带英文」同口径;代价量化:书法实高 102px vs 154px,号占 61px、缝 17px)
|
||||
- **W3** 底板 满版 / 留白版 → 推荐 **满版**(启动页那块系统本就留边,再自缩 14.5% 会显小)
|
||||
|
||||
拍完:选定版去掉后缀转正式件,未选版进 `alt/`,本文件补裁定段。
|
||||
本包属站外载体,**不进 `public/`**、不改站点代码。
|
||||
@@ -0,0 +1,279 @@
|
||||
{
|
||||
"plate": {
|
||||
"w": 702,
|
||||
"h": 180
|
||||
},
|
||||
"pad": 0.86,
|
||||
"files": {
|
||||
"wecom-avatar-full-512.png": {
|
||||
"source": "assets-delivery/avatar-standard.svg",
|
||||
"size": "512x512",
|
||||
"kind": "avatar"
|
||||
},
|
||||
"wecom-avatar-full-144.png": {
|
||||
"source": "assets-delivery/avatar-standard.svg",
|
||||
"size": "144x144",
|
||||
"kind": "avatar"
|
||||
},
|
||||
"wecom-avatar-ring2-512.png": {
|
||||
"source": "assets-delivery/avatar-ceremonial.svg",
|
||||
"size": "512x512",
|
||||
"kind": "avatar"
|
||||
},
|
||||
"wecom-avatar-ring2-144.png": {
|
||||
"source": "assets-delivery/avatar-ceremonial.svg",
|
||||
"size": "144x144",
|
||||
"kind": "avatar"
|
||||
},
|
||||
"wecom-logo-stacked-702x180-white.png": {
|
||||
"source": "../../public/logo.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 462,
|
||||
"h": 180
|
||||
},
|
||||
"pad": {
|
||||
"l": 120,
|
||||
"r": 120,
|
||||
"t": 0,
|
||||
"b": 0
|
||||
},
|
||||
"limit": "height",
|
||||
"inkAspect": 2.565,
|
||||
"inkOverCanvas": 0.728
|
||||
},
|
||||
"wecom-logo-stacked-702x180-transparent.png": {
|
||||
"source": "../../public/logo.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 462,
|
||||
"h": 180
|
||||
},
|
||||
"pad": {
|
||||
"l": 120,
|
||||
"r": 120,
|
||||
"t": 0,
|
||||
"b": 0
|
||||
},
|
||||
"limit": "height",
|
||||
"inkAspect": 2.565,
|
||||
"inkOverCanvas": 0.728
|
||||
},
|
||||
"wecom-logo-stacked-702x180-reversed.png": {
|
||||
"source": "../../public/logo-white.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 462,
|
||||
"h": 180
|
||||
},
|
||||
"pad": {
|
||||
"l": 120,
|
||||
"r": 120,
|
||||
"t": 0,
|
||||
"b": 0
|
||||
},
|
||||
"limit": "height",
|
||||
"inkAspect": 2.565,
|
||||
"inkOverCanvas": 0.728
|
||||
},
|
||||
"wecom-logo-stacked-2x-1404x360-white.png": {
|
||||
"source": "../../public/logo.svg",
|
||||
"size": "1404x360",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 923,
|
||||
"h": 360
|
||||
},
|
||||
"pad": {
|
||||
"l": 240,
|
||||
"r": 241,
|
||||
"t": 0,
|
||||
"b": 0
|
||||
}
|
||||
},
|
||||
"wecom-logo-stacked-pad-702x180-white.png": {
|
||||
"source": "../../public/logo.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 395,
|
||||
"h": 154
|
||||
},
|
||||
"pad": {
|
||||
"l": 154,
|
||||
"r": 153,
|
||||
"t": 13,
|
||||
"b": 13
|
||||
},
|
||||
"limit": "height",
|
||||
"inkAspect": 2.565,
|
||||
"inkOverCanvas": 0.728
|
||||
},
|
||||
"wecom-logo-stacked-pad-702x180-transparent.png": {
|
||||
"source": "../../public/logo.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 395,
|
||||
"h": 154
|
||||
},
|
||||
"pad": {
|
||||
"l": 154,
|
||||
"r": 153,
|
||||
"t": 13,
|
||||
"b": 13
|
||||
},
|
||||
"limit": "height",
|
||||
"inkAspect": 2.565,
|
||||
"inkOverCanvas": 0.728
|
||||
},
|
||||
"wecom-logo-stacked-pad-702x180-reversed.png": {
|
||||
"source": "../../public/logo-white.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 395,
|
||||
"h": 154
|
||||
},
|
||||
"pad": {
|
||||
"l": 154,
|
||||
"r": 153,
|
||||
"t": 13,
|
||||
"b": 13
|
||||
},
|
||||
"limit": "height",
|
||||
"inkAspect": 2.565,
|
||||
"inkOverCanvas": 0.728
|
||||
},
|
||||
"wecom-logo-name-702x180-white.png": {
|
||||
"source": "assets-delivery/name-alone.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 702,
|
||||
"h": 154
|
||||
},
|
||||
"pad": {
|
||||
"l": 0,
|
||||
"r": 0,
|
||||
"t": 13,
|
||||
"b": 13
|
||||
},
|
||||
"limit": "width",
|
||||
"inkAspect": 4.557,
|
||||
"inkOverCanvas": 0.511
|
||||
},
|
||||
"wecom-logo-name-702x180-transparent.png": {
|
||||
"source": "assets-delivery/name-alone.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 702,
|
||||
"h": 154
|
||||
},
|
||||
"pad": {
|
||||
"l": 0,
|
||||
"r": 0,
|
||||
"t": 13,
|
||||
"b": 13
|
||||
},
|
||||
"limit": "width",
|
||||
"inkAspect": 4.557,
|
||||
"inkOverCanvas": 0.511
|
||||
},
|
||||
"wecom-logo-name-702x180-reversed.png": {
|
||||
"source": "assets-delivery/name-alone-reversed.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 702,
|
||||
"h": 154
|
||||
},
|
||||
"pad": {
|
||||
"l": 0,
|
||||
"r": 0,
|
||||
"t": 13,
|
||||
"b": 13
|
||||
},
|
||||
"limit": "width",
|
||||
"inkAspect": 4.557,
|
||||
"inkOverCanvas": 0.511
|
||||
},
|
||||
"wecom-logo-name-2x-1404x360-white.png": {
|
||||
"source": "assets-delivery/name-alone.svg",
|
||||
"size": "1404x360",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 1404,
|
||||
"h": 308
|
||||
},
|
||||
"pad": {
|
||||
"l": 0,
|
||||
"r": 0,
|
||||
"t": 26,
|
||||
"b": 26
|
||||
}
|
||||
},
|
||||
"wecom-logo-name-pad-702x180-white.png": {
|
||||
"source": "assets-delivery/name-alone.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 676,
|
||||
"h": 148
|
||||
},
|
||||
"pad": {
|
||||
"l": 13,
|
||||
"r": 13,
|
||||
"t": 16,
|
||||
"b": 16
|
||||
},
|
||||
"limit": "width",
|
||||
"inkAspect": 4.557,
|
||||
"inkOverCanvas": 0.511
|
||||
},
|
||||
"wecom-logo-name-pad-702x180-transparent.png": {
|
||||
"source": "assets-delivery/name-alone.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 676,
|
||||
"h": 148
|
||||
},
|
||||
"pad": {
|
||||
"l": 13,
|
||||
"r": 13,
|
||||
"t": 16,
|
||||
"b": 16
|
||||
},
|
||||
"limit": "width",
|
||||
"inkAspect": 4.557,
|
||||
"inkOverCanvas": 0.511
|
||||
},
|
||||
"wecom-logo-name-pad-702x180-reversed.png": {
|
||||
"source": "assets-delivery/name-alone-reversed.svg",
|
||||
"size": "702x180",
|
||||
"kind": "plate",
|
||||
"ink": {
|
||||
"w": 676,
|
||||
"h": 148
|
||||
},
|
||||
"pad": {
|
||||
"l": 13,
|
||||
"r": 13,
|
||||
"t": 16,
|
||||
"b": 16
|
||||
},
|
||||
"limit": "width",
|
||||
"inkAspect": 4.557,
|
||||
"inkOverCanvas": 0.511
|
||||
}
|
||||
},
|
||||
"avatars": [
|
||||
"full",
|
||||
"ring2"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
企业微信资产包门禁(第五十二刀)
|
||||
|
||||
跑法:/usr/bin/python3 check-wecom.py
|
||||
退出码分档(不是"红=1"一把梭):0 全绿 / 1 判红 / 2 门禁自身崩溃或夹具缺失
|
||||
|
||||
四条判据都配了**负对照**,负对照不判红就等于这条判据没有约束力:
|
||||
B 圆即底板 ← 现网 assets-delivery/icon-512x512.png(圆角方版)必须被判红
|
||||
D 板内居中 ← 故意平移 6px 的副本必须被判红
|
||||
E 朱砂面积带 ← 把红涂满整板的副本必须被判红
|
||||
F 反白无彩 ← 给反白版塞一枚朱砂 A 的副本必须被判红
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
try:
|
||||
from PIL import Image
|
||||
except Exception as e: # 解释器选错会读成"依赖缺失",见记忆 reference-python-pillow-path
|
||||
print("FATAL 需要 Pillow,且必须用 /usr/bin/python3 跑:", e)
|
||||
sys.exit(2)
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
PKG = os.path.join(HERE, "assets-wecom")
|
||||
RED = (196, 30, 58) # #C41E3A
|
||||
ALPHA_EDGE = 8 # 视为"全透明"的上限
|
||||
fails, oks, expected = [], [], []
|
||||
|
||||
|
||||
def ok(msg):
|
||||
oks.append(msg)
|
||||
print(f" ok {msg}")
|
||||
|
||||
|
||||
def bad(msg):
|
||||
fails.append(msg)
|
||||
print(f" RED {msg}")
|
||||
|
||||
|
||||
def name_size(fn):
|
||||
m = re.search(r"(\d+)x(\d+)", fn)
|
||||
if m:
|
||||
return int(m.group(1)), int(m.group(2))
|
||||
m = re.search(r"-(\d+)\.png$", fn)
|
||||
return (int(m.group(1)), int(m.group(1))) if m else (None, None)
|
||||
|
||||
|
||||
def is_red(px):
|
||||
return abs(px[0] - RED[0]) + abs(px[1] - RED[1]) + abs(px[2] - RED[2]) <= 30
|
||||
|
||||
|
||||
def red_ratio(im):
|
||||
"""朱砂像素占全板比例(%)。透明像素不算红。"""
|
||||
im = im.convert("RGBA")
|
||||
w, h = im.size
|
||||
px = im.load()
|
||||
n = 0
|
||||
for y in range(h):
|
||||
for x in range(w):
|
||||
p = px[x, y]
|
||||
if p[3] > 128 and is_red(p):
|
||||
n += 1
|
||||
return 100.0 * n / (w * h)
|
||||
|
||||
|
||||
def ink_mask(im):
|
||||
"""返回 (mask, w, h)。mask[y][x]=1 表示该像素是"墨"。
|
||||
白底板:非白即墨;透明底:不透明即墨。"""
|
||||
im = im.convert("RGBA")
|
||||
w, h = im.size
|
||||
px = im.load()
|
||||
opaque_white = 0
|
||||
total = 0
|
||||
mask = []
|
||||
for y in range(h):
|
||||
row = []
|
||||
for x in range(w):
|
||||
r, g, b, a = px[x, y]
|
||||
total += 1
|
||||
if a <= ALPHA_EDGE:
|
||||
row.append(0)
|
||||
continue
|
||||
if r >= 245 and g >= 245 and b >= 245 and a >= 250:
|
||||
row.append(0)
|
||||
continue
|
||||
row.append(1)
|
||||
mask.append(row)
|
||||
return mask, w, h, px
|
||||
|
||||
|
||||
def bbox(mask, w, h):
|
||||
xs = [x for row in mask for x, v in enumerate(row) if v]
|
||||
ys = [y for y, row in enumerate(mask) if any(row)]
|
||||
if not xs or not ys:
|
||||
return None
|
||||
return min(xs), min(ys), max(xs), max(ys)
|
||||
|
||||
|
||||
def check_circle_lossless(path, label, must_fail=False):
|
||||
"""内切圆**之外**的像素必须全透明 —— 头像版是"圆即底板",方版被圆裁掉的是底板四角。
|
||||
⚠ 这条**不是**"咬字"判据:实测两版白字最远极径都在内切圆内(余量 8.0% / 10.3%),
|
||||
它判的是"这枚圆是被设计的,还是被裁出来的"。"""
|
||||
im = Image.open(path).convert("RGBA")
|
||||
w, h = im.size
|
||||
cx = cy = (w - 1) / 2.0
|
||||
r = w / 2.0
|
||||
px = im.load()
|
||||
viol = 0
|
||||
for y in range(h):
|
||||
dy = y - cy
|
||||
for x in range(w):
|
||||
dx = x - cx
|
||||
if dx * dx + dy * dy > (r + 1.0) ** 2 and px[x, y][3] > ALPHA_EDGE:
|
||||
viol += 1
|
||||
total = w * h
|
||||
if viol:
|
||||
msg = f"{label}: 内切圆外残留 {viol} 个不透明像素({100.0*viol/total:.2f}%)⇒ 圆裁会切掉底板四角,方版语义丢失"
|
||||
if must_fail:
|
||||
expected.append("B 圆角方版负对照: " + msg)
|
||||
ok("预期红(负对照被抓):" + msg)
|
||||
else:
|
||||
bad(msg)
|
||||
else:
|
||||
msg = f"{label}: 圆外零残留,圆即底板"
|
||||
(bad if must_fail else ok)(f"负对照未被抓 ⇒ B 条无约束力:{msg}" if must_fail else msg)
|
||||
|
||||
|
||||
def check_plate(path, label, must_fail=False):
|
||||
"""must_fail=True 用于负对照:判红是**预期红**,登记进 expected 而不是计进失败数
|
||||
(否则"闸抓得越准,退出码越红",正是记忆里那条退出码分档的反例)。"""
|
||||
mask, w, h, px = ink_mask(Image.open(path))
|
||||
bb = bbox(mask, w, h)
|
||||
if not bb:
|
||||
(bad if not must_fail else ok)(f"{label}: 一个墨像素都没有")
|
||||
return
|
||||
x0, y0, x1, y1 = bb
|
||||
l, r, t, b = x0, w - 1 - x1, y0, h - 1 - y1
|
||||
msg = f"{label}: 墨 {x1-x0+1}x{y1-y0+1} 左右差 {l-r}、上下差 {t-b}"
|
||||
if max(l, r) >= w or max(t, b) >= h:
|
||||
(ok if must_fail else bad)("预期红:墨越出板外 —— " + msg if must_fail else "墨越出板外 —— " + msg)
|
||||
return
|
||||
if abs(l - r) > 1 or abs(t - b) > 1:
|
||||
if must_fail:
|
||||
expected.append("E 平移负对照: " + msg)
|
||||
ok("预期红(负对照被抓):" + msg)
|
||||
else:
|
||||
bad("未居中 —— " + msg)
|
||||
else:
|
||||
if must_fail:
|
||||
bad(f"负对照未被抓 ⇒ E 条无约束力:{msg}")
|
||||
else:
|
||||
ok("居中 —— " + msg)
|
||||
|
||||
|
||||
def main():
|
||||
if not os.path.isdir(PKG):
|
||||
print(f"FATAL 资产包缺失:{PKG}")
|
||||
return 2
|
||||
import json
|
||||
|
||||
rp = os.path.join(PKG, "pack-report.json")
|
||||
if not os.path.exists(rp):
|
||||
print(f"FATAL 装配报告缺失:{rp} ⇒ 先跑 wecom-pack.cjs,别拿半套包过闸")
|
||||
return 2
|
||||
report = json.load(open(rp, encoding="utf-8"))
|
||||
files = sorted(f for f in os.listdir(PKG) if f.endswith(".png"))
|
||||
if len(files) < 14:
|
||||
print(f"FATAL 只找到 {len(files)} 张 PNG,少于 14 ⇒ 判据覆盖面不足")
|
||||
return 2
|
||||
print(f"[A] IHDR 尺寸必须等于文件名声明({len(files)} 张)")
|
||||
for f in files:
|
||||
want = name_size(f)
|
||||
got = Image.open(os.path.join(PKG, f)).size
|
||||
(ok if got == want else bad)(f"{f}: 声明 {want[0]}x{want[1]} 实测 {got[0]}x{got[1]}")
|
||||
|
||||
print("\n[A2] 装配报告登记的每张必须真在盘上(防「备好但从未跑成」)")
|
||||
declared, present = set(report.get("files", {})), set(files)
|
||||
missing, extra = sorted(declared - present), sorted(present - declared)
|
||||
(ok if not missing else bad)(f"登记 {len(declared)} 张,盘上缺 {len(missing)} 张" + "".join(f" [{m}]" for m in missing))
|
||||
(ok if not extra else bad)(f"盘上未登记 {len(extra)} 张" + "".join(f" [{e}]" for e in extra))
|
||||
|
||||
print("\n[B] 头像:圆即底板(内切圆外不许有任何不透明像素)")
|
||||
for f in files:
|
||||
if f.startswith("wecom-avatar-"):
|
||||
check_circle_lossless(os.path.join(PKG, f), f)
|
||||
print(" —— 负对照(现网圆角方版,必须被判红)")
|
||||
check_circle_lossless(os.path.join(HERE, "assets-delivery", "icon-512x512.png"), "icon-512x512.png", must_fail=True)
|
||||
|
||||
print("\n[C] 头像:中心是朱砂地(白文印的底不能丢)")
|
||||
for f in files:
|
||||
if f.startswith("wecom-avatar-"):
|
||||
im = Image.open(os.path.join(PKG, f)).convert("RGBA")
|
||||
c = im.load()[im.size[0] // 2, im.size[1] // 2]
|
||||
(ok if is_red(c) else bad)(f"{f}: 中心像素 {c[:3]}")
|
||||
|
||||
print("\n[D] 头像:512 与 144 两档的朱砂占比必须同格(容差按抗锯齿的 1/尺寸律给,不假装它是 0)")
|
||||
for kind in ("full", "ring2"):
|
||||
ratios = {}
|
||||
for px_ in (512, 144):
|
||||
p = os.path.join(PKG, f"wecom-avatar-{kind}-{px_}.png")
|
||||
if os.path.exists(p):
|
||||
ratios[px_] = red_ratio(Image.open(p))
|
||||
if len(ratios) == 2:
|
||||
d = abs(ratios[512] - ratios[144])
|
||||
(ok if d <= 3.0 else bad)(f"{kind}: 512 占 {ratios[512]:.2f}% / 144 占 {ratios[144]:.2f}% 差 {d:.2f}pt(闸 3.0)")
|
||||
print(" —— 负对照(把圆面缩 30%,模拟被咬/缩水,必须被抓)")
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
im = Image.open(os.path.join(PKG, "wecom-avatar-full-512.png")).convert("RGBA")
|
||||
small = im.resize((358, 358), Image.LANCZOS)
|
||||
canvas = Image.new("RGBA", (512, 512), (0, 0, 0, 0))
|
||||
canvas.paste(small, (77, 77), small)
|
||||
p2 = os.path.join(td, "wecom-avatar-shrunk-512.png")
|
||||
canvas.save(p2)
|
||||
base = red_ratio(Image.open(os.path.join(PKG, "wecom-avatar-full-512.png")))
|
||||
shrunk = red_ratio(Image.open(p2))
|
||||
d = abs(base - shrunk)
|
||||
(ok if d > 3.0 else bad)(f"负对照缩水后占比 {base:.2f}%→{shrunk:.2f}% 差 {d:.2f}pt ⇒ " + ("被抓" if d > 3.0 else "未被抓 ⇒ D 条对'面变小'不敏感"))
|
||||
|
||||
print("\n[E] 企业logo 板:居中 + 尺寸")
|
||||
for f in files:
|
||||
if f.startswith("wecom-logo-"):
|
||||
check_plate(os.path.join(PKG, f), f)
|
||||
print(" —— 负对照(故意平移 6px,必须被判红)")
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
src = os.path.join(PKG, "wecom-logo-stacked-702x180-white.png")
|
||||
im = Image.open(src).convert("RGBA")
|
||||
canvas = Image.new("RGBA", im.size, (255, 255, 255, 255))
|
||||
canvas.paste(im.crop((6, 0, im.size[0], im.size[1])), (0, 0))
|
||||
shifted = os.path.join(td, "wecom-logo-shifted-702x180-white.png")
|
||||
canvas.save(shifted)
|
||||
check_plate(shifted, "shifted-6px(负对照)", must_fail=True)
|
||||
|
||||
print("\n[F] 白底板:朱砂面积 —— 有红的版必须落在 0.1%–10%(R6 面积律,两端都要断);"
|
||||
"\n 源字标本身不含红的版(name 只走名、不含号 ⇒ 无 A 可加彩)断言恰为 0,不硬要它出红")
|
||||
src_red = {}
|
||||
for f, meta in report.get("files", {}).items():
|
||||
s = os.path.join(HERE, meta.get("source", ""))
|
||||
src_red[f] = os.path.exists(s) and 'fill="#C41E3A"' in open(s, encoding="utf-8").read()
|
||||
for f in files:
|
||||
if f.endswith("-white.png"):
|
||||
ratio = red_ratio(Image.open(os.path.join(PKG, f)))
|
||||
if src_red.get(f):
|
||||
(ok if 0.1 <= ratio <= 10.0 else bad)(f"{f}: 朱砂 {ratio:.2f}%(源含红)")
|
||||
else:
|
||||
(ok if ratio == 0.0 else bad)(f"{f}: 朱砂 {ratio:.2f}%(源不含红 ⇒ 期望恰 0)")
|
||||
print(" —— 负对照(把红涂满整板,必须被判红)")
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
im = Image.open(os.path.join(PKG, "wecom-logo-stacked-702x180-white.png")).convert("RGBA")
|
||||
px = im.load()
|
||||
for y in range(im.size[1]):
|
||||
for x in range(im.size[0]):
|
||||
if px[x, y][3] > ALPHA_EDGE and not is_red(px[x, y]):
|
||||
px[x, y] = (RED[0], RED[1], RED[2], 255)
|
||||
p2 = os.path.join(td, "wecom-logo-allred-702x180-white.png")
|
||||
im.save(p2)
|
||||
ratio = red_ratio(Image.open(p2))
|
||||
caught = not (0.1 <= ratio <= 10.0)
|
||||
(ok if caught else bad)(f"负对照全红 {ratio:.2f}% ⇒ " + ("被抓" if caught else "未被抓 ⇒ F 条无约束力"))
|
||||
|
||||
print("\n[G] 反白版:0 朱砂(裁定「反白不加彩也不加粗」)")
|
||||
for f in files:
|
||||
if f.endswith("-reversed.png"):
|
||||
ratio = red_ratio(Image.open(os.path.join(PKG, f)))
|
||||
(ok if ratio == 0.0 else bad)(f"{f}: 朱砂 {ratio:.2f}%")
|
||||
print(" —— 负对照(给反白版塞一枚朱砂 A,必须被判红)")
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
im = Image.open(os.path.join(PKG, "wecom-logo-stacked-702x180-reversed.png")).convert("RGBA")
|
||||
px = im.load()
|
||||
n = 0
|
||||
for y in range(im.size[1]):
|
||||
for x in range(im.size[0]):
|
||||
if px[x, y][3] > 128 and n < 400:
|
||||
px[x, y] = (RED[0], RED[1], RED[2], 255)
|
||||
n += 1
|
||||
p2 = os.path.join(td, "wecom-logo-redstain-702x180-reversed.png")
|
||||
im.save(p2)
|
||||
ratio = red_ratio(Image.open(p2))
|
||||
(ok if ratio > 0 else bad)(f"负对照染色 {ratio:.3f}% ⇒ " + ("被抓" if ratio > 0 else "未被抓 ⇒ G 条无约束力"))
|
||||
|
||||
print("\n[H] 透明墨色版:不许出现纯白像素(底板没剥干净会留白块)")
|
||||
for f in files:
|
||||
if f.endswith("-transparent.png"):
|
||||
im = Image.open(os.path.join(PKG, f)).convert("RGBA")
|
||||
px = im.load()
|
||||
w, h = im.size
|
||||
n = sum(
|
||||
1
|
||||
for y in range(h)
|
||||
for x in range(w)
|
||||
if px[x, y][3] > 250 and px[x, y][0] >= 250 and px[x, y][1] >= 250 and px[x, y][2] >= 250
|
||||
)
|
||||
(ok if n == 0 else bad)(f"{f}: 纯白不透明像素 {n}")
|
||||
|
||||
# 预期红必须有条数下限:一条都没有 = 负对照根本没跑成,那上面所有"ok"都失去自证
|
||||
(ok if len(expected) >= 2 else bad)(f"预期红登记 {len(expected)} 条(负对照至少 2 条:B 圆角方版、E 平移)")
|
||||
print("\n预期红明细(负对照,不计失败):")
|
||||
for m in expected:
|
||||
print(" 预期红:", m)
|
||||
print(f"\n{'='*58}\n判红 {len(fails)} 项 / 通过 {len(oks)} 项")
|
||||
for m in fails:
|
||||
print(" RED:", m)
|
||||
return 1 if fails else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
sys.exit(main())
|
||||
except SystemExit:
|
||||
raise
|
||||
except Exception:
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
print("EXIT=2 门禁自身崩溃(与判红不是同一件事,别混)")
|
||||
sys.exit(2)
|
||||
@@ -0,0 +1,184 @@
|
||||
// 企业微信资产包(第五十二刀)
|
||||
// 两类载体,两套判据:
|
||||
// 头像 —— 企业微信显示为圆形裁切 ⇒ 必须为圆设计(avatar-standard / avatar-ceremonial 已是圆面)
|
||||
// 企业logo —— 管理后台固定板 702×180(口径为二手转述,见 WECOM-MANIFEST.md 的存疑条)
|
||||
// 栅格化用仓库自带的 sharp;尺寸一律由 viewBox 反推 density,不靠"看着调"。
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const sharp = require("sharp");
|
||||
|
||||
const HERE = __dirname;
|
||||
const REPO = path.dirname(path.dirname(HERE));
|
||||
const D = path.join(HERE, "assets-delivery");
|
||||
const OUT = path.join(HERE, "assets-wecom");
|
||||
|
||||
const AVATARS = {
|
||||
full: path.join(D, "avatar-standard.svg"),
|
||||
ring2: path.join(D, "avatar-ceremonial.svg"),
|
||||
};
|
||||
const LOGOS = {
|
||||
stacked: { ink: path.join(REPO, "public/logo.svg"), reversed: path.join(REPO, "public/logo-white.svg") },
|
||||
name: { ink: path.join(D, "name-alone.svg"), reversed: path.join(D, "name-alone-reversed.svg") },
|
||||
};
|
||||
|
||||
const PLATE = { w: 702, h: 180 };
|
||||
const PAD = 0.86; // 留白版:板内四周各内缩 7% 板高(13px)后再装墨
|
||||
|
||||
function viewBox(file) {
|
||||
const m = /viewBox="([^"]+)"/.exec(fs.readFileSync(file, "utf8"));
|
||||
if (!m) throw new Error(`${path.basename(file)} 没有 viewBox`);
|
||||
const [, , w, h] = m[1].split(/\s+/).map(Number);
|
||||
if (!(w > 0 && h > 0)) throw new Error(`${path.basename(file)} viewBox 非法: ${m[1]}`);
|
||||
return { w, h };
|
||||
}
|
||||
|
||||
// 纯路径校验:交付件不许有 <text>,不许引外部字体
|
||||
// ⚠ 先剥 XML 注释 —— 这些文件的来源注释里就写着「现网那份用 <text>」,不剥会把判据读成自伤
|
||||
function assertPurePaths(file) {
|
||||
const s = fs.readFileSync(file, "utf8").replace(/<!--[\s\S]*?-->/g, "");
|
||||
if (/<text/.test(s)) throw new Error(`${path.basename(file)} 含 <text>`);
|
||||
if (/https?:\/\//.test(s.replace(/xmlns="[^"]*"/g, ""))) throw new Error(`${path.basename(file)} 含外链`);
|
||||
}
|
||||
|
||||
async function raster(svg, targetH) {
|
||||
const vb = viewBox(svg);
|
||||
const density = (72 * targetH) / vb.h; // 1 用户单位 = targetH/vb.h 设备像素
|
||||
// ⚠ sharp.resize(宽, 高):targetH 是**高**,别把它当宽传进去(上一版就是这么把墨块排成 180×384 的)
|
||||
return sharp(svg, { density }).resize(Math.round((targetH * vb.w) / vb.h), targetH, { fit: "fill" }).png().toBuffer();
|
||||
}
|
||||
|
||||
// 按**墨盒**居中,不按画布盒。实测这些字标的 viewBox 上下留了空盒:
|
||||
// name-alone 画布高 96 而墨只 66 单位,stacked 画布 119.82 而墨 100 上下各空 —— 不裁就直接偏心。
|
||||
async function trimInk(buf) {
|
||||
const { data, info } = await sharp(buf).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
|
||||
const { width: w, height: h } = info;
|
||||
let x0 = w, y0 = h, x1 = -1, y1 = -1;
|
||||
for (let y = 0; y < h; y++) {
|
||||
for (let x = 0; x < w; x++) {
|
||||
if (data[(y * w + x) * 4 + 3] > 8) {
|
||||
if (x < x0) x0 = x;
|
||||
if (x > x1) x1 = x;
|
||||
if (y < y0) y0 = y;
|
||||
if (y > y1) y1 = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (x1 < x0) throw new Error("一个不透明像素都没有");
|
||||
const meta = await sharp(buf).metadata();
|
||||
const slack = { top: y0, bottom: meta.height - 1 - y1, left: x0, right: meta.width - 1 - x1 };
|
||||
const cropped = await sharp(buf).extract({ left: x0, top: y0, width: x1 - x0 + 1, height: y1 - y0 + 1 }).png().toBuffer();
|
||||
return { buf: cropped, slack };
|
||||
}
|
||||
|
||||
// 先高倍栅格 + 裁墨,再把**墨盒**装进板内最大缩放 —— 两个理由:
|
||||
// ① 这些字标的 viewBox 上下带空盒(实测 stacked 墨只占画布高 73%、name 52%),按画布排等于缩得不够;
|
||||
// ② name 的墨宽高比实测 4.50,比 702×180 的板(3.90)还扁 ⇒ 它只能按**宽**限死,按高排必溢出。
|
||||
async function inkFit(svg, boxW, boxH) {
|
||||
const probe = 720;
|
||||
const { buf: trimmed } = await trimInk(await raster(svg, probe));
|
||||
const m = await sharp(trimmed).metadata();
|
||||
const sW = boxW / m.width;
|
||||
const sH = boxH / m.height;
|
||||
const s = Math.min(sW, sH);
|
||||
const w = Math.round(m.width * s);
|
||||
const h = Math.round(m.height * s);
|
||||
const buf = await sharp(trimmed).resize(w, h, { fit: "fill" }).png().toBuffer();
|
||||
return { buf, limit: sW < sH ? "width" : "height", inkOverCanvas: m.height / probe, aspect: m.width / m.height };
|
||||
}
|
||||
|
||||
async function plate(inkBuf, bg) {
|
||||
const m = await sharp(inkBuf).metadata();
|
||||
const left = Math.round((PLATE.w - m.width) / 2);
|
||||
const top = Math.round((PLATE.h - m.height) / 2);
|
||||
const buf = await sharp({ create: { width: PLATE.w, height: PLATE.h, channels: 4, background: bg } })
|
||||
.composite([{ input: inkBuf, left, top }])
|
||||
.png()
|
||||
.toBuffer();
|
||||
return { buf, ink: { w: m.width, h: m.height }, pad: { l: left, r: PLATE.w - m.width - left, t: top, b: PLATE.h - m.height - top } };
|
||||
}
|
||||
|
||||
const WHITE_BG = { r: 255, g: 255, b: 255, alpha: 1 };
|
||||
const CLEAR = { r: 0, g: 0, b: 0, alpha: 0 };
|
||||
|
||||
(async () => {
|
||||
fs.mkdirSync(OUT, { recursive: true });
|
||||
const report = { plate: PLATE, pad: PAD, files: {} };
|
||||
|
||||
for (const [kind, svg] of Object.entries(AVATARS)) {
|
||||
assertPurePaths(svg);
|
||||
for (const px of [512, 144]) {
|
||||
const name = `wecom-avatar-${kind}-${px}.png`;
|
||||
const buf = await raster(svg, px);
|
||||
await sharp(buf).resize(px, px, { fit: "fill" }).png().toFile(path.join(OUT, name));
|
||||
report.files[name] = { source: path.relative(HERE, svg), size: `${px}x${px}`, kind: "avatar" };
|
||||
}
|
||||
}
|
||||
|
||||
for (const [variant, src] of Object.entries(LOGOS)) {
|
||||
assertPurePaths(src.ink);
|
||||
assertPurePaths(src.reversed);
|
||||
const padPx = Math.round(PLATE.h * ((1 - PAD) / 2));
|
||||
const boxes = { full: { w: PLATE.w, h: PLATE.h }, pad: { w: PLATE.w - 2 * padPx, h: PLATE.h - 2 * padPx } };
|
||||
for (const [fit, box] of Object.entries(boxes)) {
|
||||
const suffix = fit === "full" ? "" : "-pad";
|
||||
const jobs = [
|
||||
[`wecom-logo-${variant}${suffix}-${PLATE.w}x${PLATE.h}-white.png`, src.ink, WHITE_BG],
|
||||
[`wecom-logo-${variant}${suffix}-${PLATE.w}x${PLATE.h}-transparent.png`, src.ink, CLEAR],
|
||||
[`wecom-logo-${variant}${suffix}-${PLATE.w}x${PLATE.h}-reversed.png`, src.reversed, CLEAR],
|
||||
];
|
||||
for (const [name, svg, bg] of jobs) {
|
||||
const { buf: inkBuf, limit, aspect, inkOverCanvas } = await inkFit(svg, box.w, box.h);
|
||||
const { buf, ink, pad } = await plate(inkBuf, bg);
|
||||
await fs.writeFileSync(path.join(OUT, name), buf);
|
||||
report.files[name] = {
|
||||
source: path.relative(HERE, svg),
|
||||
size: `${PLATE.w}x${PLATE.h}`,
|
||||
kind: "plate",
|
||||
ink,
|
||||
pad,
|
||||
limit,
|
||||
inkAspect: Number(aspect.toFixed(3)),
|
||||
inkOverCanvas: Number(inkOverCanvas.toFixed(3)),
|
||||
};
|
||||
}
|
||||
if (fit === "full") {
|
||||
// @2x 高清备份(只出白底板,上传框按 702×180 用)
|
||||
const big = { w: PLATE.w * 2, h: PLATE.h * 2 };
|
||||
const { buf: trimmed } = await inkFit(src.ink, big.w, big.h);
|
||||
const m = await sharp(trimmed).metadata();
|
||||
const name = `wecom-logo-${variant}-2x-${big.w}x${big.h}-white.png`;
|
||||
const left = Math.floor((big.w - m.width) / 2);
|
||||
const top = Math.floor((big.h - m.height) / 2);
|
||||
const buf = await sharp({ create: { width: big.w, height: big.h, channels: 4, background: WHITE_BG } })
|
||||
.composite([{ input: trimmed, left, top }])
|
||||
.png()
|
||||
.toBuffer();
|
||||
await fs.writeFileSync(path.join(OUT, name), buf);
|
||||
report.files[name] = {
|
||||
source: path.relative(HERE, src.ink),
|
||||
size: `${big.w}x${big.h}`,
|
||||
kind: "plate",
|
||||
ink: { w: m.width, h: m.height },
|
||||
pad: { l: left, r: big.w - m.width - left, t: top, b: big.h - m.height - top },
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
report.avatars = Object.keys(AVATARS);
|
||||
fs.writeFileSync(path.join(OUT, "pack-report.json"), JSON.stringify(report, null, 2));
|
||||
const names = Object.keys(report.files).sort();
|
||||
console.log(`生成 ${names.length} 张 → assets-wecom/`);
|
||||
for (const n of names) {
|
||||
const f = report.files[n];
|
||||
const kb = (fs.statSync(path.join(OUT, n)).size / 1024).toFixed(1);
|
||||
console.log(
|
||||
` ${n} ${f.size} ${kb}KB` +
|
||||
(f.ink ? ` 墨${f.ink.w}x${f.ink.h} 留白 l${f.pad.l}/${f.pad.r} t${f.pad.t}/${f.pad.b}` : "") +
|
||||
(f.inkOverCanvas ? ` 墨/画布 ${f.inkOverCanvas} 墨宽高比 ${f.inkAspect}` : "")+(f.limit ? ` 限${f.limit}` : "")
|
||||
);
|
||||
}
|
||||
})().catch((e) => {
|
||||
console.error("FAIL", e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -0,0 +1,186 @@
|
||||
# 2026-10-21 全系统验收(UI / UE / UX 视觉为重点)
|
||||
|
||||
> 状态:进行中(axe / Lighthouse / 全量 E2E 结果待补)。本文件只写**已经实际执行**的读数;未执行项明确标为「待补 / 未做」。
|
||||
|
||||
## 0. 结论(暂定)
|
||||
|
||||
- **判定:有条件通过(暂定)**——未发现 P0/P1,但存在 **5 类 P2** 视觉/UE 问题:网格空槽、指标大字换行、Admin 移动端公共 tab bar 泄漏、Admin 移动端表格塌陷、联系表单在 1440×900 首屏之下。
|
||||
- 验收对象:`dev` @ `dee0c483`,本地重建 `BUILD_ID=i17AJGx-nZqOkCudx46f9`;生产线上 `BUILD_ID=KO7S41-qvKY89xp5Kczbl`(发布 `2f86c441`,2026-10-20 14:05)。
|
||||
- 核心读数:静态/单元门禁全绿;视觉回归 **123 passed / 2 failed**(两例均为 webkit dwell 装配竞态,非像素回归);全路由 sweep **195 次运行 / 0 hard failure**;Admin **45 次运行 / 0 hard failure**;生产只读 **34/35 路由 200**(`/_not-found` 404 为契约);安全响应头 **8/8**。**axe 全站门禁首跑 EXIT=1(firefox-only 6/3 个 contrast 节点),但隔离复跑 5/5 为 0,静态令牌配对均 ≥4.58:1 ⇒ 判为门禁 settle 竞态,尚未取得可信的 a11y 全绿读数(见 §6/TA-05)。**
|
||||
- **未授权动作**:未写视觉基线、未改产品源码、未 commit/push、未部署、未写生产库;写库 E2E 仅打 `/tmp` 副本库。
|
||||
|
||||
## 1. 环境与取证
|
||||
|
||||
| 项 | 读数 |
|
||||
|---|---|
|
||||
| 分支 / HEAD | `dev` / `dee0c4835c8446a46c7694587610876a70b20aa4`(与 `origin/dev`、`origin/main` 同步,工作树干净) |
|
||||
| 本地构建 | `npm run build:clean` EXIT=0,2026-10-21 09:20:25–09:20:53;`dist/BUILD_ID = i17AJGx-nZqOkCudx46f9`,与 `dist/standalone/dist/BUILD_ID` 一致 |
|
||||
| standalone 装配 | `dist/standalone/{server.js,dist/static,public}` 三项齐备(`ASSEMBLY_OK`) |
|
||||
| 主服务 | `node dist/standalone/server.js` on `127.0.0.1:3100`,PID 49285,启动 09:48:37;`DATABASE_URL=file:/tmp/novalon-qa-20261021/dev.db` |
|
||||
| DB 副本 | `sqlite3 prisma/dev.db ".backup ..."` → `/tmp/novalon-qa-20261021/dev.db`,1,241,088 bytes |
|
||||
| 生产发布 | `BUILD_ID=KO7S41-qvKY89xp5Kczbl`(`docs/development/deploy-runbook.md` §3.4) |
|
||||
|
||||
**装配口径两处必须记住**(本轮实际踩到):
|
||||
|
||||
1. `npm run build:clean` **不会触发** `postbuild` 钩子(npm 只跑 `postbuild:clean`),本次按 `package.json:9` 的 postbuild 命令手工装配后才得到可用产物。后续用 `npm run build` 或补 `postbuild:clean`。
|
||||
2. 本地 `.env.local` 与 `.env.production` 的加密密钥**不同**:构建内联了 `.env.local` 的 `NEXT_PUBLIC_ENCRYPTION_SECRET`,而 standalone 运行时用了 `.env.production` 的 `ENCRYPTION_SECRET`,导致所有加密响应解密失败、Admin 仪表盘全 `-`。生产两端一致(已逐项验证),属**本地验收环境装配缺陷**;本轮以 `ENCRYPTION_SECRET=<.env.local 值>` 重启服务后 Admin 恢复正常。
|
||||
|
||||
## 2. 门禁矩阵(逐条 EXIT)
|
||||
|
||||
| 检查 | 命令 | EXIT | 真实读数 | 证据 |
|
||||
|---|---|---|---|---|
|
||||
| 类型 | `npm run type-check` | 0 | 0 error | `logs/gate-typecheck.log` |
|
||||
| E2E 类型 | `npm run type-check:e2e` | 0 | 0 error | `logs/gate-typecheck-e2e.log` |
|
||||
| Lint | `npm run lint` | 0 | **0 error / 84 warning** | `logs/gate-lint.log` |
|
||||
| 单元 + 覆盖率 | `npm run test:coverage` | 0 | **149 suites / 1815 tests**;All files **89.56 stmts / 88.28 branch / 88.18 funcs / 89.56 lines** | `logs/gate-coverage.log` |
|
||||
| 真库集成 | `npm run test:integration:real` | 0 | **4 suites / 23 tests**;`prisma/dev.db` inode+size+mtime 守卫通过 | `logs/gate-integration-real.log` |
|
||||
| 静态 a11y | `npm run check:a11y` | 0 | 11/11 页 0 问题;对比度/标题/品牌令牌三件套全绿 | `logs/gate-a11y.log` |
|
||||
| 视觉语法 | `npm run check:visual` | 0 | grammar/accents 及 selftest 通过;R10 hover-lift 棘轮未升 | `logs/gate-visual-check.log` |
|
||||
| 动效约束 | `npm run check:motion` | 0 | 256 文件、0 违规 | `logs/gate-motion.log` |
|
||||
| 包键一致性 | `npm run check:package-keys` | 0 | 通过 | `logs/gate-package-keys.log` |
|
||||
| 生产安全头 | `npm run test:security:headers` | 0 | **8/8 PASS**(CSP/HSTS/XFO/nosniff/Referrer/Permissions/XSS/ACAO) | `logs/security-headers.log` |
|
||||
|
||||
## 3. 视觉回归(只读,不写基线)
|
||||
|
||||
命令:`cd e2e && E2E_TARGET=production DATABASE_URL=file:/tmp/novalon-qa-20261021/dev.db npx playwright test visual-regression.spec.ts --update-snapshots=none`
|
||||
|
||||
- **123 passed / 2 failed / 5.3m / EXIT=1**;5 个 project、127 张既有基线,未写任何参照。
|
||||
- 两例红均在 `visual-webkit-desktop` L1:
|
||||
- `/products`:154,897 px(ratio 0.01);隔离 `--workers=1` 复跑 **passed**。
|
||||
- `/about/brand`:1,411,676 px(ratio 0.04);隔离复跑仍红。
|
||||
- **归因:测试装配 dwell 竞态,不是像素回归。** actual/expected **页高一致**,差异带内 actual 是 `opacity:0` 的空白(品牌使命/愿景、时间线等 ScrollReveal 区块未显影),符合 `docs/lessons-learned.md` §5.51 签名 1。独立探针:webkit 同页 120ms/步快速滚动后 mission/timeline opacity=0;改成 350ms/步后均为 1。`/products` 隔离转绿进一步排除产品回归。
|
||||
- **不据此更新基线**:若把竞态固化成参照,会把「未显影」写进批准资产。
|
||||
|
||||
## 4. 全路由视觉 / UI / UX Sweep
|
||||
|
||||
脚本:`scripts/acceptance/sweep-routes.mjs`(新增,复用 2026-10-20 首页探针的 settle / 懒加载 / 祖先 opacity 逻辑)。
|
||||
分母:`check:axe:routes` 的机器清单 **35 条**(sitemap ∪ 预渲染 ∪ BFS;含 `/_not-found`、`/cases`、`/privacy`、`/terms`、动态 slug),不是人工数的 22 条。
|
||||
|
||||
- 矩阵:35 × `{1440 浅/深, 834 浅, 390 浅/深}` × chromium = 175;另 firefox/webkit 抽 `/ /about /contact /products` + 一条详情 × `{1440 浅, 390 浅}` = 20;合计 **195 次运行**。
|
||||
- **0 hard failure**:
|
||||
- 祖先链 opacity <0.99:**0**
|
||||
- 横向溢出:**0**
|
||||
- 破图(eager + 逐屏滚动后 `complete && naturalWidth>0`):**0**
|
||||
- `pageerror`:**0**
|
||||
- 同源 4xx/5xx:**0**(唯一例外 `/_not-found` 文档 404,按契约豁免)
|
||||
- console error:**5 次,全部是 `/_not-found` 的 404 资源提示**
|
||||
- **设计契约实测**:
|
||||
- 品牌红触达:最少 **1**(`/privacy`),其余页面 ≥2;`/privacy`、`/terms`、404 暗色低于「每页 ≥3」的规则(见 P3)。
|
||||
- 红色像素占比最高 **4.37%**(404 页),全部 <10%。
|
||||
- 直角/字阶/动效:`check:visual` + `check:motion` 静态门全绿;运行时副作用见 P2。
|
||||
- **联系表单首屏**:form top = **1064px @1440×900**、1547 @834、1254 @390 → **三种视口都不在首屏**(DESIGN.md 称 contact 为紧凑档、表单回首屏,见 P2)。
|
||||
|
||||
## 5. Admin UI / UX(9 页 × 5 组合 + 状态)
|
||||
|
||||
- 登录:`admin/admin123`(UI 表单,水合后 1.2s 再提交);Dashboard 实测 **16 模型 / 38 条目 / 6 区域 / 3 活跃用户 / 已发布 38**;登录失败提示「用户名或密码错误」已实测。
|
||||
- 45 次运行(9 路由 × 5 组合)**0 hard failure**;390 档 18 次运行全部检出 **公共站点的 `mobile-tab-bar`**。
|
||||
- 已覆盖状态:登录错误、Dashboard 数据、内容列表、编辑器(`/new`,因列表项为 `router.push` 按钮、无 `<a>`,未抓到既有条目 id)、空媒体库、通知、角色、用户、区域、删除确认弹窗(打开后取消,未写库)、`e2e_editor` 直访 `/admin/users` 的拒绝态。
|
||||
- 主要发现:
|
||||
- **公共移动 tab bar 泄漏到全部 `/admin` 与 `/admin/login`**(根布局 `src/app/layout.tsx:218` 无条件渲染 `<MobileTabBar />`)。
|
||||
- **390 内容列表不可用**:标题列被压成逐字竖排(「四 川 睿 新…」),状态签也竖排;表格为 `w-full` + 外层 `overflow-x-auto`,只压缩不滚动(`src/app/admin/content/[modelCode]/page.tsx:179-180`)。
|
||||
- 拒绝态保留了「创建用户」按钮与表头,仅以横幅提示「仅管理员可查看用户列表」;无权限时仍显示可点击入口(P3)。
|
||||
- Admin 暗色主题整体可用,活动项对比偏低(P3)。
|
||||
- 移动端触控目标偏小:密码可见性按钮 16×16、菜单按钮 28×28、登录按钮高 43px(P3)。
|
||||
|
||||
## 6. a11y / 性能 / 线上只读
|
||||
|
||||
- **axe 全站节点计数:未通过,但判为门禁 settle 竞态,不是产品对比度缺陷。**
|
||||
- 首跑(`axe/axe-evidence.json`):EXIT=1,**firefox/light 6 nodes、firefox/dark 3 nodes**,chromium 两主题 0;节点集中在首页 ledger 指标、「配套服务」卡、首页行业卡 `text-white/70`、about 数据标签。
|
||||
- 原样重跑(`axe-rerun/axe-evidence.json`):EXIT=1,但**失败集合漂移**为 **chromium/dark 3、firefox/light 1、firefox/dark 1**,chromium/light 0 ⇒ 不是稳定的静态对比度对。
|
||||
- 隔离复跑:同一 gate 时序在 firefox/light `/` 上 **5/5 为 0**;受控慢滚动 + `reducedMotion:'reduce'` 的 20 次运行(5 路由 × chromium/firefox × light/dark)**0 violation**(`axe-fixed-settle.json`)。
|
||||
- 静态配对复核:`text-muted/bg-secondary=5.31:1`、`text-secondary/brand-soft12=9.53:1`、`brand-ink/brand-soft12=4.58:1`、`dark muted/bg-primary=4.98:1` ⇒ 均 ≥4.5:1。
|
||||
- 机理:gate 的 `settle()` 是「直接跳到底 → 回顶 → 400ms」,`ScrollReveal` 元素在 axe 运行时可能仍处入场中间态;有效 opacity <1 会把 5.31:1 压到 ~2:1。与 `docs/lessons-learned.md` §5.51 同族。
|
||||
- **结论口径**:本轮不把 axe 红计为产品 a11y 缺陷,但**也不能宣称全站 a11y 全绿**;门禁本身需修(逐屏 dwell / 等 reveal 完成 / reduce 模式)后再作为发布判据。
|
||||
- **Lighthouse:EXIT=0,33/33 run 全部断言通过**(11 URL × 3 run,`:3200` 自起 standalone,桌面 preset)。
|
||||
- 四类目(performance / accessibility / best-practices / SEO)在 11 条 URL 上**中位数全部 1.00**。
|
||||
- 中位 Core Web Vitals:FCP **246–336ms**、LCP **534–822ms**、CLS **0**、TBT **0ms**、SI **266–572ms**。
|
||||
- 明细:`lighthouse-summary.json`(只统计 2026-10-21 10:00 之后的报告,避开 `.lighthouseci/` 的历史轮次)。
|
||||
- **线上只读冒烟**(仅 GET):35 路由中 **34 条 200**,`/_not-found` 404(契约);首访最慢 `/products/erp-upgrade 4.79s`、`/team 4.32s`,二次访问 1.43s / 1.12s(冷 ISR 首访,不是持续慢)。
|
||||
- **线上 8 次同口径运行**(`prod-compare/`,/ /about /contact /products × 1440/390):opacity=1、无横向溢出、0 破图、0 console/pageerror、0 失败请求;H1 与本地一致。
|
||||
- **本地 vs 线上资产指纹**:19 个 `_next/static` 引用中 15 个相同、4 个不同(CSS + 3 JS)。原因:线上是 `2f86c441`(BUILD_ID KO7S41…),本地 HEAD 还含 `b125d16a`(hero hover token)等后续提交。**像素对照只作参考,不作回归判据**。
|
||||
- **webkit axe**:仍不在任何门禁矩阵内(已知缺口,如实保留)。
|
||||
|
||||
## 7. UX 行为补测
|
||||
|
||||
- **定向 spec:136 passed / 8 skipped / 0 failed / 2.1m / EXIT=0**(production 目标、副本库、4 project)。
|
||||
- 覆盖 `first-paint-visibility`(无 JS 兜底 / 水合交接)、`reduced-motion-hydration`(reduce 下 #418 与末段可见)、`client-navigation-visibility`(白屏回归守卫)、`nav-keyboard`、`nav-dropdown`、`p6-missing-paths`(含联系表单完整成功提交)、`p5-edge-cases`、404/错误边界。
|
||||
- 8 skipped 均为 `nav-keyboard` 在 `chromium-mobile` / `webkit` 上的设计性跳过(桌面下拉键盘用例不适用于移动档)。
|
||||
- 联系表单「填写有效信息并提交成功」实测通过 ⇒ 加密链路与 `/api/contact` 在本地产物上可用(前提:运行时 secret 与构建内联 secret 一致)。
|
||||
- `[待补]` 全量功能 E2E(4 project,副本库;含 `cms-workflow` / `user-journey`)。
|
||||
- 已由 sweep 覆盖:35 路由客户端渲染可见性、移动 tab bar 可见性、触控盒分布、404、暗色主题切换、表单在场与首屏位置。
|
||||
|
||||
## 8. 缺陷清单
|
||||
|
||||
### P0 / P1
|
||||
|
||||
无。
|
||||
|
||||
### P2(计入「有条件通过」)
|
||||
|
||||
| ID | 缺陷 | 证据 | 影响面 |
|
||||
|---|---|---|---|
|
||||
| DEF-01 | **网格列数与内容量不匹配,产生大面积空槽**(可见的 `bg-border-primary` 灰块):6 步放进 4 列、3 指标放进 4 列、4 服务放进 2 列、2 产品放进 5 列(`col-span` 还挂在卡片内层而非 grid 子项)、首页 5 指标放进 4 列 | `sweep-summary.json`:**19 条路由 / 73 次运行命中**;截图 `products__1440__light__chromium__full.webp`、`products_erp__1440__light__chromium__full.webp`、`services__1440__light__chromium__full.webp`、`solutions_manufacturing__1440__light__chromium__full.webp` | 产品详情、服务、解决方案、产品 hub、首页 |
|
||||
| DEF-02 | **指标大字在 1440 宽度换行**:81px 字号落在 209px 内容宽里,`40%+` / `99.2%` / `3-6个月` / `+113%` 被拆成两行 | `sweep-summary.json`:8 次运行;`products_erp__1440__light__chromium__full.webp`、`products_crm__1440__light__chromium__full.webp` | `/products/erp`、`/products/crm`(1440 浅/深) |
|
||||
| DEF-03 | **公共移动 tab bar 泄漏到 Admin**:`/admin`、`/admin/login` 及全部子页在 390 档显示「首页/行业/能力/洞察/联系」,fixed 覆盖 admin 内容 | `admin-content_news__390__light__chromium__hero.jpg`;report `admin.tabBarOn390=18/18` | 全部 9 个 admin 路由 |
|
||||
| DEF-04 | **Admin 移动端内容表塌陷**:标题列逐字竖排、状态签竖排,表格只压缩不横向滚动 | 同上 screenshot;源码 `src/app/admin/content/[modelCode]/page.tsx:179-180` | `/admin/content/*`、`/admin/users` 等表格页 390 档 |
|
||||
| DEF-05 | **联系表单不在首屏**:form top 1064 @1440×900(DESIGN.md 称 contact 紧凑档、表单回首屏) | `contact__1440__light__chromium__full.webp`;sweep `form.top` | `/contact` 全视口 |
|
||||
|
||||
**DEF-01 源码定位**(只报告,不改):`src/app/(marketing)/products/product-detail-content-v3.tsx:232`(6 步 / 4 列)、`src/components/content/sections.tsx:355`(3 指标 / 4 列)、`src/app/(marketing)/services/services-content-v3.tsx:193-199`(4 服务 / 2 列 + 首项 span 2)、`src/app/(marketing)/solutions/solution-detail-content-v3.tsx:296-325`(5 列 grid;`+` 与配套服务在 grid 外)、`src/app/(marketing)/home-content-v16.tsx:239`(5 指标 / 4 列)。
|
||||
|
||||
### P3(记录,不阻断)
|
||||
|
||||
- **红色触达计数是「元素级令牌」口径,不是视觉面积口径**:`/privacy` 计 1、`/terms` 计 2、404 暗色计 2,但这三页都有整幅红底 hero(视觉红色占比 2.6% / 2.5% / 4.4%)。**不将其登记为「红色稀缺」缺陷**;若要判「每页 ≥3 触达」,需要把伪元素/渐变/背景图纳入计数,属仪器口径待改。
|
||||
- Admin 拒绝态仍渲染「创建用户」按钮与表头(`admin-permission-denied__1440__light__chromium__full.jpg`)。
|
||||
- Admin 移动端触控目标 <44px:密码可见性 16×16、菜单 28×28、登录按钮 43px。
|
||||
- Dashboard「最近通知」在 160 条通知(全部已读)下显示「暂无通知」;面板名为「最近通知」,空态语义偏窄。
|
||||
- Admin 暗色活动项对比偏低(如侧栏「仪表盘」深底上的深色块)。
|
||||
|
||||
### 测试/环境装配(不计入产品缺陷)
|
||||
|
||||
- **TA-01**:webkit 视觉门禁 dwell 竞态(2 例),详见 §3;`--workers=1` 仍可能红,签名是「同高空白带」。
|
||||
- **TA-02**:`build:clean` 不触发 `postbuild`,standalone 装配需手工补。
|
||||
- **TA-03**:本地 `.env.local` / `.env.production` 加密密钥不一致 ⇒ 加密响应解密失败、Admin 全 `-`;生产两端一致。
|
||||
- **TA-04**:`/_not-found` 文档 404 曾被 harness 误判为 hard failure;已在 sweep 中按契约豁免。
|
||||
- **TA-05**:全站 axe 门禁的 `settle()`(跳底→回顶→400ms)在带动画的页面上不稳定:两次连跑失败集合漂移(firefox 6/3 → chromium/dark 3 + firefox 1/1),隔离 5/5 与受控 20/20 均为 0。**门禁需改为逐屏 dwell / 等 reveal 完成 / reduce 模式**,否则 `check:axe` 的红绿不可复现。
|
||||
|
||||
## 9. 未做 / 不可自动判
|
||||
|
||||
- 真机 iOS/Android、VoiceOver/NVDA 等屏幕阅读器实测。
|
||||
- 颜色校准/不同显示器色差;摄影构图与中文排版节奏的审美判断(本报告只做启发式评审)。
|
||||
- 联系表单真实邮件送达、生产库与本地副本一致性。
|
||||
- webkit axe 矩阵(现有 axe 只跑 chromium+firefox)。
|
||||
- **全站 axe 的可信全绿读数**:门禁 settle 竞态(TA-05)未修,现有两次全站跑均红且失败集合漂移;仅静态 a11y 三件套与受控抽检为绿。
|
||||
- hover/半透明/伪元素对比度(axe 与静态门不判)。
|
||||
- framer JS 动效时长的运行时测量(`check:motion` 只扫源码;浏览器 computed 读不到 framer duration)。
|
||||
- 视觉基线的重写/新增(本轮未获授权;只读比对)。
|
||||
- 全量变异测试、Sentry 投递、Axe 之外的第三方审计。
|
||||
|
||||
## 10. 复跑与证据
|
||||
|
||||
```bash
|
||||
# 1) 构建 + 装配(build:clean 需手工补 postbuild)
|
||||
npm run build:clean
|
||||
rm -rf dist/standalone/dist/static dist/standalone/public
|
||||
mkdir -p dist/standalone/dist
|
||||
cp -R dist/static dist/standalone/dist/static
|
||||
cp -R public dist/standalone/public
|
||||
|
||||
# 2) 副本库
|
||||
sqlite3 prisma/dev.db ".backup '/tmp/novalon-qa-20261021/dev.db'"
|
||||
|
||||
# 3) 服务(运行时 ENCRYPTION_SECRET 必须与构建内联的 public secret 一致)
|
||||
DATABASE_URL=file:/tmp/novalon-qa-20261021/dev.db ENCRYPTION_SECRET=<.env.local 值> \
|
||||
HOSTNAME=127.0.0.1 PORT=3100 node dist/standalone/server.js
|
||||
|
||||
# 4) 全路由 sweep
|
||||
BASE=http://127.0.0.1:3100 ROUTES=/tmp/qa-routes.xml OUT=docs/acceptance/2026-10-21-full-qa \
|
||||
node scripts/acceptance/sweep-routes.mjs
|
||||
|
||||
# 5) contact sheet
|
||||
node scripts/acceptance/contact-sheet.mjs \
|
||||
docs/acceptance/2026-10-21-full-qa/screenshots/public \
|
||||
docs/acceptance/2026-10-21-full-qa/contact-sheets
|
||||
```
|
||||
|
||||
证据目录:`README.md`、`build-attestation.json`、`routes.json`、`report.json`、`report-public.json`、`sweep-summary.json`、`screenshots/{public,admin}`、`prod-compare/`、`axe/`、`logs/`。
|
||||
DB 指纹:运行前 `logs/../`(`/tmp/novalon-qa-20261021/db.sha256.before`、`db.stat.before`)与运行后见 §11 `[待补]`。
|
||||
@@ -0,0 +1,122 @@
|
||||
[
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "light",
|
||||
"path": "/",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "light",
|
||||
"path": "/about",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "light",
|
||||
"path": "/solutions/logistics",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "light",
|
||||
"path": "/products/erp",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "light",
|
||||
"path": "/contact",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "dark",
|
||||
"path": "/",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "dark",
|
||||
"path": "/about",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "dark",
|
||||
"path": "/solutions/logistics",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "dark",
|
||||
"path": "/products/erp",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "chromium",
|
||||
"theme": "dark",
|
||||
"path": "/contact",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "light",
|
||||
"path": "/",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "light",
|
||||
"path": "/about",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "light",
|
||||
"path": "/solutions/logistics",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "light",
|
||||
"path": "/products/erp",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "light",
|
||||
"path": "/contact",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "dark",
|
||||
"path": "/",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "dark",
|
||||
"path": "/about",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "dark",
|
||||
"path": "/solutions/logistics",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "dark",
|
||||
"path": "/products/erp",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"theme": "dark",
|
||||
"path": "/contact",
|
||||
"violations": []
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"generatedAt": "2026-10-21T01:21:32.234Z",
|
||||
"head": "dee0c4835c8446a46c7694587610876a70b20aa4",
|
||||
"branch": "dev",
|
||||
"worktreeClean": true,
|
||||
"buildId": "i17AJGx-nZqOkCudx46f9",
|
||||
"buildIdMatchesStandalone": true,
|
||||
"buildStart": "1792545625 2026-10-21 09:20:25",
|
||||
"buildEnd": "1792545653 2026-10-21 09:20:53",
|
||||
"buildExit": "0",
|
||||
"assembly": {
|
||||
"staticDir": true,
|
||||
"publicDir": true,
|
||||
"serverJs": true
|
||||
},
|
||||
"server": {
|
||||
"port": 3100,
|
||||
"pid": 1044,
|
||||
"startedAt": "Wed Oct 21 09:21:19 2026",
|
||||
"databaseUrl": "file:/tmp/novalon-qa-20261021/dev.db"
|
||||
},
|
||||
"dbCopy": {
|
||||
"path": "/tmp/novalon-qa-20261021/dev.db",
|
||||
"size": 1241088,
|
||||
"sha256": "75dff3fbad7f5d1f10b9f908f2e1752f8d3466c8a6a4432c812c45924bfdba97 /tmp/novalon-qa-20261021/dev.db"
|
||||
},
|
||||
"devDbBefore": [
|
||||
"8bd6b7adb1ef9311243e225dc7b21dd8a4bd07c799237906f29f00c1a323ad1a prisma/dev.db",
|
||||
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 prisma/dev.db-wal",
|
||||
"fd4c9fda9cd3f9ae7c962b0ddf37232294d55580e1aa165aa06129b8549389eb prisma/dev.db-shm"
|
||||
],
|
||||
"devDbStatBefore": [
|
||||
"prisma/dev.db size=1241088 mtime=1792545494 inode=398998151",
|
||||
"prisma/dev.db-wal size=0 mtime=1792545494 inode=484282668",
|
||||
"prisma/dev.db-shm size=32768 mtime=1792545621 inode=484282669"
|
||||
],
|
||||
"note": "build:clean 不会触发 npm postbuild 钩子;standalone 静态装配已按 postbuild 脚本手工执行并校验。"
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"cycle": "2026-10-21-full-qa",
|
||||
"head": "dee0c4835c8446a46c7694587610876a70b20aa4",
|
||||
"buildId": "i17AJGx-nZqOkCudx46f9",
|
||||
"verdict": "conditional-pass",
|
||||
"defects": [
|
||||
{
|
||||
"id": "DEF-01",
|
||||
"severity": "P2",
|
||||
"type": "ui-layout",
|
||||
"title": "网格列数与内容量不匹配,产生大面积可见空槽",
|
||||
"detail": "6 步放进 4 列、3 指标放进 4 列、4 服务放进 2 列(首项 span 2)、2 产品放进 5 列(col-span 挂在卡片内层)、首页 5 指标放进 4 列;bg-border-primary 让空格变成整块灰底。",
|
||||
"blastRadius": "19 条路由 / 73 次运行命中",
|
||||
"routes": ["/products", "/products/erp", "/products/bi", "/products/cms", "/products/crm", "/products/oa", "/products/sds", "/services", "/services/consulting", "/services/data", "/services/software", "/services/solutions", "/solutions", "/solutions/education", "/solutions/finance", "/solutions/healthcare", "/solutions/logistics", "/solutions/manufacturing", "/solutions/retail"],
|
||||
"source": [
|
||||
"src/app/(marketing)/products/product-detail-content-v3.tsx:232",
|
||||
"src/components/content/sections.tsx:355",
|
||||
"src/app/(marketing)/services/services-content-v3.tsx:193-199",
|
||||
"src/app/(marketing)/solutions/solution-detail-content-v3.tsx:296-325",
|
||||
"src/app/(marketing)/home-content-v16.tsx:239"
|
||||
],
|
||||
"evidence": [
|
||||
"sweep-summary.json",
|
||||
"screenshots/public/products__1440__light__chromium__full.webp",
|
||||
"screenshots/public/products_erp__1440__light__chromium__full.webp",
|
||||
"screenshots/public/services__1440__light__chromium__full.webp",
|
||||
"screenshots/public/solutions_manufacturing__1440__light__chromium__full.webp"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "DEF-02",
|
||||
"severity": "P2",
|
||||
"type": "ui-typography",
|
||||
"title": "指标大字在 1440 宽度断行",
|
||||
"detail": "81px 字号落在 209px 内容宽里,40%+ / 99.2% / 3-6个月 / +113% 被拆成两行;1440 浅/深均复现。",
|
||||
"blastRadius": "8 次运行",
|
||||
"routes": ["/products/erp", "/products/crm"],
|
||||
"source": ["src/components/content/sections.tsx:363"],
|
||||
"evidence": ["sweep-summary.json", "screenshots/public/products_erp__1440__light__chromium__full.webp", "screenshots/public/products_crm__1440__light__chromium__full.webp"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-03",
|
||||
"severity": "P2",
|
||||
"type": "ui-cross-route-leak",
|
||||
"title": "公共移动 tab bar 泄漏到 Admin",
|
||||
"detail": "根布局无条件渲染 MobileTabBar;/admin 与 /admin/login 在 390 档显示「首页/行业/能力/洞察/联系」,fixed 覆盖 admin 内容。",
|
||||
"blastRadius": "9 个 admin 路由 / 390 档 18 次运行全部命中",
|
||||
"routes": ["/admin", "/admin/login", "/admin/content/news", "/admin/content/news/new", "/admin/media", "/admin/notifications", "/admin/roles", "/admin/users", "/admin/zones"],
|
||||
"source": ["src/app/layout.tsx:218"],
|
||||
"evidence": ["screenshots/admin/admin-content_news__390__light__chromium__hero.jpg", "report.json (adminRuns[].mobileTabBar)", "contact-sheets/admin-390-light-chromium.jpg"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-04",
|
||||
"severity": "P2",
|
||||
"type": "ui-responsive",
|
||||
"title": "Admin 移动端内容表塌陷",
|
||||
"detail": "390 档标题列被压成逐字竖排、状态签竖排;外层 overflow-x-auto + table w-full 只压缩不横向滚动。",
|
||||
"blastRadius": "/admin/content/*、/admin/users 等表格页 390 档",
|
||||
"source": ["src/app/admin/content/[modelCode]/page.tsx:179-180", "src/app/admin/users/page.tsx:289-290"],
|
||||
"evidence": ["screenshots/admin/admin-content_news__390__light__chromium__hero.jpg", "screenshots/admin/admin-content_news__390__light__chromium__full.webp", "screenshots/admin/admin-users__390__light__chromium__full.webp"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-05",
|
||||
"severity": "P2",
|
||||
"type": "ue-above-the-fold",
|
||||
"title": "联系表单不在首屏",
|
||||
"detail": "form top = 1064px @1440×900、1547 @834、1254 @390;DESIGN.md 称 contact 为紧凑档、表单回到首屏。",
|
||||
"blastRadius": "/contact 全视口",
|
||||
"source": ["src/app/(marketing)/contact/contact-content-v3.tsx"],
|
||||
"evidence": ["sweep-summary.json", "screenshots/public/contact__1440__light__chromium__full.webp"]
|
||||
}
|
||||
],
|
||||
"p3": [
|
||||
{
|
||||
"id": "P3-01",
|
||||
"title": "Admin 拒绝态仍渲染「创建用户」入口与表头",
|
||||
"evidence": "screenshots/admin/admin-permission-denied__1440__light__chromium__full.jpg"
|
||||
},
|
||||
{
|
||||
"id": "P3-02",
|
||||
"title": "Admin 移动端触控目标偏小:密码可见性 16×16、菜单 28×28、登录按钮 43px",
|
||||
"evidence": "report.json (adminRuns[].touchTargets)"
|
||||
},
|
||||
{
|
||||
"id": "P3-03",
|
||||
"title": "Dashboard「最近通知」在 160 条全部已读时显示「暂无通知」",
|
||||
"evidence": "screenshots/admin/admin-root__1440__light__chromium__full.webp"
|
||||
},
|
||||
{
|
||||
"id": "P3-04",
|
||||
"title": "Admin 暗色活动项对比偏低",
|
||||
"evidence": "screenshots/admin/admin-root__1440__dark__chromium__full.webp"
|
||||
}
|
||||
],
|
||||
"testInfrastructure": [
|
||||
{
|
||||
"id": "TA-01",
|
||||
"title": "webkit 视觉回归 dwell 竞态(2 例)",
|
||||
"detail": "123 passed / 2 failed;/products 隔离转绿,/about/brand 隔离仍红;同高空白带,350ms 慢滚动后 reveal 全部 opacity=1。"
|
||||
},
|
||||
{
|
||||
"id": "TA-02",
|
||||
"title": "build:clean 不触发 postbuild",
|
||||
"detail": "本轮手工执行 package.json:9 的装配命令后才得到可用 standalone 产物。"
|
||||
},
|
||||
{
|
||||
"id": "TA-03",
|
||||
"title": "本地 .env.local / .env.production 加密密钥不一致",
|
||||
"detail": "构建内联 .env.local 的 public secret,standalone 运行时用 .env.production 的 server secret ⇒ 加密响应解密失败、Admin 全 -;以运行时 secret 对齐后恢复。生产两端一致。"
|
||||
},
|
||||
{
|
||||
"id": "TA-04",
|
||||
"title": "/_not-found 文档 404 被 sweep 误判为 hard failure",
|
||||
"detail": "已在 sweep 中按契约豁免。"
|
||||
},
|
||||
{
|
||||
"id": "TA-05",
|
||||
"title": "axe 全站门禁 settle 竞态",
|
||||
"detail": "两次全站跑均 EXIT=1 且失败集合漂移;隔离 5/5 与受控 20/20 均为 0;静态令牌配对均 ≥4.58:1。门禁红绿不可复现。"
|
||||
},
|
||||
{
|
||||
"id": "TA-06",
|
||||
"title": "UJ-10 与 UJ-03 共享副本库的并发写读",
|
||||
"detail": "UJ-10 断言新闻恰 2 篇时收到 3 篇,多出的是 UJ-03 并发创建并稍后清理的测试新闻;属测试隔离问题,待隔离复跑确认。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"/": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 254,
|
||||
"lcp": 658,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 266
|
||||
},
|
||||
"/about": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 336,
|
||||
"lcp": 697,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 396
|
||||
},
|
||||
"/services": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 248,
|
||||
"lcp": 609,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 442
|
||||
},
|
||||
"/products": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 250,
|
||||
"lcp": 534,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 389
|
||||
},
|
||||
"/cases": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 330,
|
||||
"lcp": 710,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 449
|
||||
},
|
||||
"/news": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 248,
|
||||
"lcp": 654,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 521
|
||||
},
|
||||
"/insights": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 250,
|
||||
"lcp": 628,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 274
|
||||
},
|
||||
"/solutions/manufacturing": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 252,
|
||||
"lcp": 638,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 572
|
||||
},
|
||||
"/contact": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 332,
|
||||
"lcp": 822,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 459
|
||||
},
|
||||
"/products/erp-upgrade": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 248,
|
||||
"lcp": 625,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 342
|
||||
},
|
||||
"/about/brand": {
|
||||
"runs": 6,
|
||||
"perf": 1,
|
||||
"a11y": 1,
|
||||
"bp": 1,
|
||||
"seo": 1,
|
||||
"fcp": 246,
|
||||
"lcp": 606,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 312
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"generatedAt": "2026-10-21T01:21:37.871Z",
|
||||
"count": 35,
|
||||
"routes": [
|
||||
"/",
|
||||
"/_not-found",
|
||||
"/about",
|
||||
"/about/brand",
|
||||
"/cases",
|
||||
"/contact",
|
||||
"/insights",
|
||||
"/methodology",
|
||||
"/news",
|
||||
"/news/company-founded",
|
||||
"/news/digital-transformation-solution",
|
||||
"/privacy",
|
||||
"/products",
|
||||
"/products/bi",
|
||||
"/products/cms",
|
||||
"/products/crm",
|
||||
"/products/erp",
|
||||
"/products/erp-upgrade",
|
||||
"/products/erp-upgrade-v3",
|
||||
"/products/oa",
|
||||
"/products/sds",
|
||||
"/services",
|
||||
"/services/consulting",
|
||||
"/services/data",
|
||||
"/services/software",
|
||||
"/services/solutions",
|
||||
"/solutions",
|
||||
"/solutions/education",
|
||||
"/solutions/finance",
|
||||
"/solutions/healthcare",
|
||||
"/solutions/logistics",
|
||||
"/solutions/manufacturing",
|
||||
"/solutions/retail",
|
||||
"/team",
|
||||
"/terms"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
{
|
||||
"public": {
|
||||
"runs": 195,
|
||||
"hard": 0,
|
||||
"opacityBelow099": 0,
|
||||
"overflowX": 0,
|
||||
"brokenImages": 0,
|
||||
"pageErrors": 0,
|
||||
"consoleErrorRuns": 5,
|
||||
"thirdPartyRuns": 172
|
||||
},
|
||||
"detectors": {
|
||||
"wrappedNumberRoutes": [
|
||||
"/products/crm",
|
||||
"/products/erp"
|
||||
],
|
||||
"gridGapRoutes": [
|
||||
"/products",
|
||||
"/products/bi",
|
||||
"/products/cms",
|
||||
"/products/crm",
|
||||
"/products/erp",
|
||||
"/products/oa",
|
||||
"/products/sds",
|
||||
"/services",
|
||||
"/services/consulting",
|
||||
"/services/data",
|
||||
"/services/software",
|
||||
"/services/solutions",
|
||||
"/solutions",
|
||||
"/solutions/education",
|
||||
"/solutions/finance",
|
||||
"/solutions/healthcare",
|
||||
"/solutions/logistics",
|
||||
"/solutions/manufacturing",
|
||||
"/solutions/retail"
|
||||
],
|
||||
"orphanColSpanRoutes": [
|
||||
"/products",
|
||||
"/solutions/education",
|
||||
"/solutions/finance",
|
||||
"/solutions/healthcare",
|
||||
"/solutions/logistics",
|
||||
"/solutions/manufacturing",
|
||||
"/solutions/retail"
|
||||
],
|
||||
"wrappedOccurrences": 8,
|
||||
"gridGapOccurrences": 73
|
||||
},
|
||||
"design": {
|
||||
"redTouchMin": 1,
|
||||
"redPixelRatioTop": [
|
||||
{
|
||||
"route": "/_not-found",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0437
|
||||
},
|
||||
{
|
||||
"route": "/_not-found",
|
||||
"vp": "390",
|
||||
"theme": "dark",
|
||||
"p": 0.0435
|
||||
},
|
||||
{
|
||||
"route": "/terms",
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"p": 0.026
|
||||
},
|
||||
{
|
||||
"route": "/terms",
|
||||
"vp": "834",
|
||||
"theme": "light",
|
||||
"p": 0.0254
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0249
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "dark",
|
||||
"p": 0.0249
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0249
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0246
|
||||
}
|
||||
]
|
||||
},
|
||||
"admin": {
|
||||
"runs": 45,
|
||||
"hard": 0,
|
||||
"overflowX": 0,
|
||||
"tabBarOn390": 18,
|
||||
"tabBarRoutes": [
|
||||
"/admin/login",
|
||||
"/admin",
|
||||
"/admin/content/news",
|
||||
"/admin/content/news/new",
|
||||
"/admin/media",
|
||||
"/admin/notifications",
|
||||
"/admin/roles",
|
||||
"/admin/users",
|
||||
"/admin/zones"
|
||||
],
|
||||
"pageErrors": 0,
|
||||
"consoleErrorRuns": 0
|
||||
},
|
||||
"form": {
|
||||
"contact": [
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "dark",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "834",
|
||||
"theme": "light",
|
||||
"top": 1547,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"top": 1254,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "dark",
|
||||
"top": 1254,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"top": 1255,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"top": 1254,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
# 修复轮(2026-10-24,接全站验收)
|
||||
|
||||
本轮按用户选择修复四条线:V3 新缺陷、GA 隐私、Admin 移动端、E2E 仪器。**未提交、未推送、未部署。**
|
||||
|
||||
## 1. 改了什么
|
||||
|
||||
### V3(DEF-06 / DEF-07 / DEF-08)
|
||||
|
||||
| 文件 | 改动 |
|
||||
|---|---|
|
||||
| `src/components/detail/metric-value.ts`(新增) | 只对「单数字 + 前后缀」做动画;`3-6个月` 等多数字值原样返回,不再被 `replace(/[^0-9.]/g,'')` 拼成 `36` |
|
||||
| `src/components/detail/detail-product-value.tsx` | `MetricCard` 使用解析器;新增 `showDataProofs` 开关 |
|
||||
| `src/components/detail/detail-trust-section.tsx` | 本地 `AnimatedCounter` 使用同一解析器 |
|
||||
| `src/components/detail/detail-cta-section.tsx` | 去掉 `bg-brand-section` 满幅红面,改为 `bg-bg-primary` + 红字/红按钮的中性 CTA(ADR-0008) |
|
||||
| `src/app/(marketing)/products/erp-upgrade-v3/page.tsx` | `showDataProofs={false}`,只保留 DetailTrustSection 的一组指标 |
|
||||
|
||||
### GA 隐私(DEF-09)
|
||||
|
||||
| 文件 | 改动 |
|
||||
|---|---|
|
||||
| `src/lib/analytics.ts` | `DEFAULT_PREFERENCES.analytics` 改为 `false`(opt-in) |
|
||||
| `src/components/analytics/GoogleAnalytics.tsx` | consent default 改为 `analytics_storage: 'denied'`;在 `config` 前从 localStorage 回放已存偏好,避免 `window.gtag` 尚未定义时 update 被丢弃 |
|
||||
| `src/components/analytics/GoogleAnalyticsWrapper.tsx` | 新增 `shouldRenderAnalytics()`;`/admin*` 不加载 GA |
|
||||
|
||||
### Admin 移动端(DEF-03 / DEF-04)
|
||||
|
||||
| 文件 | 改动 |
|
||||
|---|---|
|
||||
| `src/components/layout/mobile-tab-bar-gate.tsx`(新增) | 按 pathname 在 `/admin*` 返回 null;仍留在根布局(main/PageTransition 之外,fixed 定位不受 transform 影响) |
|
||||
| `src/app/layout.tsx` | 用 `MobileTabBarGate` 替换无条件 `MobileTabBar` |
|
||||
| `src/app/admin/content/[modelCode]/page.tsx` | 表格 `min-w-[760px]` + 关键列 `whitespace-nowrap`,让 `overflow-x-auto` 真正横向滚动 |
|
||||
| `src/app/admin/users/page.tsx` | 同上(用户名/昵称/邮箱/表头 nowrap) |
|
||||
|
||||
### E2E 仪器(TA-11 / TA-12)
|
||||
|
||||
| 文件 | 改动 |
|
||||
|---|---|
|
||||
| `e2e/user-journey.spec.ts` / `e2e/mobile-user-journeys.spec.ts` | UJ-10 过滤断言改为两篇种子 slug 的可见/缺席,不再依赖全局恰 1/2 条 |
|
||||
| `e2e/website-acceptance.spec.ts` | `pollBoundingBox` 要求连续 5 次取样稳定(80ms 间隔),避免入场 transform 中途值 |
|
||||
|
||||
## 2. 验证读数
|
||||
|
||||
### RED(修复前)
|
||||
|
||||
- 目标单测 5 failed + `metric-value.ts` 模块缺失:`3-6个月` 解析、CTA 红面、重复指标、GA 默认同意、Admin 不加载 GA。
|
||||
- E2E gate 修复前:133 passed / 2 failed / 9 skipped(UJ-10 读到并发写库新闻);并行只读 1046 / 3 failed(Logo 取样竞态)。
|
||||
|
||||
### GREEN(修复后)
|
||||
|
||||
| 检查 | 读数 |
|
||||
|---|---|
|
||||
| 目标单测 | **169 passed**(detail + analytics + layout gate) |
|
||||
| 全量单测 + 覆盖率 | **151 suites / 1830 tests passed**;All files **89.6 / 88.25 / 88.28 / 89.6** |
|
||||
| type-check / type-check:e2e | 0 error / 0 error |
|
||||
| lint | **0 error / 84 warning** |
|
||||
| check:visual / check:motion / check:a11y | EXIT=0 / 0 违规 / EXIT=0(34 页 headings 0 问题) |
|
||||
| GA consent 运行时 | 无偏好 **gcs=G100**、`analytics:false` **gcs=G100**、`analytics:true` **gcs=G101**;default 为 denied,update 在 config 前 |
|
||||
| V3 运行时 | `.bg-brand-section` **0**;CTA 背景 **rgb(255,255,255)**;`3-6个月` **1 次**;`36-个月` / 裸 `36` **0**;旧标题 0、新标题 1 |
|
||||
| Admin 390 运行时 | tab bar **false**(content/news 与 users);表格 **760px / 容器 356px**,`scrollWidth 760 > clientWidth 356`;首列 `white-space: nowrap` |
|
||||
| E2E prod gate | **135 passed / 0 failed / 9 skipped / EXIT=0** |
|
||||
| GA4 TC-GA4-001 | 4 project **4 passed** |
|
||||
| UJ-10 firefox 隔离 | **1 passed**(上一轮曾出现导航超时抖动,未复现) |
|
||||
| Logo 3 project | **3 passed**(稳定取样) |
|
||||
| 视觉 V3 基线 | 5 张重采并逐张看过(白底 CTA、单组指标、`3-6个月`) |
|
||||
| 全量视觉只读 | **225 passed / 0 failed / EXIT=0**(先 `npm run build` 清 ISR 缓存) |
|
||||
| Admin sweep | **45 runs / 0 hard / tabBarOn390 = 0**(390 档 9 路由 × 明暗) |
|
||||
|
||||
> 视觉复验的一个操作前提:写库 E2E 会把临时新闻写进 `dist/standalone/dist/server/app/news.html` 的 ISR 缓存;之后跑视觉必须先 `npm run build`,否则 `/news` 会因缓存里的 E2E 新闻假红(本轮实测 5/5 project 同型红,重建后 225/225 绿)。
|
||||
|
||||
## 3. 修复后仍未闭合
|
||||
|
||||
- **DEF-01 P2 网格空槽**、**DEF-02 P2 指标大字换行**、**DEF-05 P2 联系表单不在首屏**:属布局/设计分档,需设计/产品裁定后改源码。
|
||||
- **P3-01…04**:Admin 触控目标、拒绝态入口、最近通知空态、暗色活动项对比;未在本轮范围内。
|
||||
- **DEF-09 残余口径**:拒绝时仍有 GA cookieless collect(`gcs=G100`),符合 GA consent mode;若要求「同意前零请求」,需改为同意后才注入 GA 脚本,属独立裁定。
|
||||
- **TA-14**:firefox UJ-10 在 gate 并行轮次出现过一次导航超时(隔离 1 passed);登记为残余超时抖动,不洗成已修。
|
||||
- **视觉基线**:本轮只重采 V3 5 张;DEF-01/02/05 修复后受影响页面需再重采。
|
||||
|
||||
## 4. 工作树
|
||||
|
||||
本轮新增/修改:`metric-value.ts`、`mobile-tab-bar-gate.tsx`、对应测试;V3/GA/Admin/E2E 文件;V3 5 张基线;`FIXES.md`。未提交。
|
||||
|
||||
> 过程记录:写 RED 时曾用 Write 覆盖既有 `src/lib/analytics.test.ts`(31 个用例);已从 `HEAD` 恢复并只改默认 analytics 断言,恢复后该文件 **31 passed**。全量读数因此从误覆盖时的 1801 纠正为 **1830**。
|
||||
@@ -0,0 +1,183 @@
|
||||
# 2026-10-24 全站系统性验收(UI/UE/UX 视觉为重点)
|
||||
|
||||
> 状态:**已完成**(sweep / axe / E2E / Lighthouse / 线上只读均已取得读数)。本文件只写已经实际执行的读数,未执行项标「未做」。
|
||||
>
|
||||
> **修复轮(2026-10-24 续)**:用户选定四条线后已修 DEF-03/04/06/07/08/09 与 TA-11/12,读数与剩余项见 [FIXES.md](FIXES.md) 与 [defects-after-fix.json](defects-after-fix.json)。本文件 §0–§10 保留验收时快照,不随修复改写。
|
||||
|
||||
## 0. 结论
|
||||
|
||||
**有条件通过(conditional-pass)**:无 P0/P1;静态门禁、35 页视觉回归(225 例)、axe 双跑、34 页标题层级、Lighthouse 33 次断言、全路由 sweep 240 次运行、线上只读 35 路由均取得干净读数。仍存在 **8 条 P2**(DEF-01…07、DEF-09)与 **5 条 P3**(DEF-08 + P3-01…04),且 E2E 的 2 条 UJ-10 红已隔离证明为测试/缓存污染(TA-11)、3 条 Logo 红为取样竞态(TA-12),故不判 pass。
|
||||
|
||||
核心读数:`npm run build` EXIT=0;type-check / lint / coverage(149 suites / 1818 tests)/ integration / check:visual / check:motion / package-keys / contrast / brand-token 全 0;视觉 `--update-snapshots=none` **225 passed / 0 failed**;sweep **public 195 + admin 45 = 240 runs / 0 hard**;axe 两次 **140 rows/跑、0 违规**;headings **34/34**;Lighthouse **33/33**;线上 **34×200 + `/_not-found` 404**,8/8 渲染无硬失败,安全头 **8/8**。
|
||||
|
||||
## 1. 环境与产物
|
||||
|
||||
| 项 | 读数 |
|
||||
|---|---|
|
||||
| 分支 / HEAD | `dev` / `03be1c9e362a7009465b2792eb2b5e498cf61f2a` |
|
||||
| 构建 | `npm run build` EXIT=0,13s;视觉/sweep 主产物 `dist/BUILD_ID` = `dist/standalone/dist/BUILD_ID` = `Es_G_8BY-bB9rpDpy0thO`;E2E/Lighthouse 前为清 ISR 缓存再次重建,最终 `dist/BUILD_ID` 为 `-NZuPkiesehXht8qCPWcT` |
|
||||
| standalone 装配 | `server.js` + `dist/static`(58 files) + `public`(40 files)齐备 |
|
||||
| 主服务 | `node dist/standalone/server.js` on `127.0.0.1:3100`,`DATABASE_URL=file:/tmp/novalon-qa-20261024/dev.db`,运行时 `ENCRYPTION_SECRET` 取 `.env.local` 的 public secret |
|
||||
| 路由分母 | `check:axe:routes` 35 条;与 2026-10-21 的 35 条逐条对账:新增 0 / 消失 0 |
|
||||
| 副本库 | `prisma/dev.db` → `/tmp/novalon-qa-20261024/dev.db`;原库 sha256 `0ba87ce1…`,副本 `c13163af…` |
|
||||
| DB 指纹注意 | 构建前 sha256 `8bd6b7ad…`、构建后 `0ba87ce1…`(size 1,241,088→1,257,472)。`journal_mode=wal`,构建期 Prisma 连接触发 checkpoint;逻辑行数与最新通知时间未变(Notification 最新仍为 2026-10-21 16:50:52)。⇒ 「只比 sha256」的指纹守卫会把 checkpoint 误判为写入。 |
|
||||
|
||||
## 2. 静态门禁
|
||||
|
||||
| 检查 | 命令 | EXIT | 读数 |
|
||||
|---|---|---|---|
|
||||
| 类型 | `npm run type-check` | 0 | 0 error(7s) |
|
||||
| E2E 类型 | `npm run type-check:e2e` | 0 | 0 error(1s) |
|
||||
| Lint | `npm run lint` | 0 | **0 error / 84 warning**(11s) |
|
||||
| 单元 + 覆盖率 | `npm run test:coverage` | 0 | **149 suites / 1818 tests**;All files **89.56 stmts / 88.28 branch / 88.18 funcs / 89.56 lines** |
|
||||
| 真库集成 | `npm run test:integration:real` | 0 | **4 suites / 23 tests** |
|
||||
| 视觉语法 | `npm run check:visual` | 0 | grammar/accents 及 selftest 通过 |
|
||||
| 动效约束 | `npm run check:motion` | 0 | 252 文件、0 违规 |
|
||||
| 包键一致性 | `npm run check:package-keys` | 0 | 通过 |
|
||||
| 对比度 | `npm run check:contrast` | 0 | 44/44 配对 ≥ AA |
|
||||
| 品牌令牌 | `npm run check:brand-token` | 0 | 通过 |
|
||||
| 安全头(本地 3100) | `npm run test:security:headers -- --url http://127.0.0.1:3100` | 0 | 7/7 PASS;本地无 Cookie |
|
||||
|
||||
## 3. 视觉回归(35 公开路由 × 5 project)
|
||||
|
||||
- `VISUAL_TEST_PAGES` 从 15 扩到 **35**;`--list` = **225 例**(45/project × 5)。
|
||||
- 缺基线用 `--update-snapshots=missing` 生成:**100 张新增**(20 路由 × 5 project),既有 127 张 0 修改;每 project 45 张、全仓 227 张(含 `manual-acceptance/` 2)。
|
||||
- 生成轮读数:**125 passed / 100 failed(缺失写入信号)/ 11.0m**;失败全部是 Playwright 对「snapshot 不存在、已写 actual」的判定,不是像素回归。
|
||||
- 独立只读复跑:**225 passed / 0 failed / EXIT=0 / 9.5m**(`--update-snapshots=none`)。
|
||||
- 新基线评审:5 个 project 的 20 条首屏拼版逐张看过;chromium desktop + mobile 的 20 条全页拼版逐张看过;firefox/webkit/tablet 首屏确认无引擎差异;`blankSuspicion=0`。
|
||||
- 评审发现:新页面均正常出内容,无空白/未显影;但把既有 P2 固化进了参照(见 §9),manifest 已标 `known_defects`。
|
||||
|
||||
## 4. 全路由 sweep
|
||||
|
||||
脚本:`scripts/acceptance/sweep-routes.mjs`(复用 2026-10-21 版本,跑前/跑后 sha256 一致),`MODE=both`,BASE=3100。
|
||||
|
||||
### 4.1 公开层(35 × 5 组合 + firefox/webkit 抽样)
|
||||
|
||||
- **195 runs / 0 hard failure**;`opacity<0.99`、横向溢出、破图、pageerror 均为 **0**。
|
||||
- console error 仅 **5 次**,全部是 `/_not-found` 的文档 404(契约)。
|
||||
- `_rsc` 预取在滚动/导航时被 abort:160 runs(Next 正常噪声,不计失败);同源 HTTP 4xx/5xx:**0**;其它网络失败:**0**。
|
||||
- 检测器:
|
||||
- `gridGapRoutes` **19 条 / 73 处**(`/products`、5 个产品详情、`/services`+3 个服务详情、`/solutions`+5 个方案详情)。
|
||||
- `orphanColSpanRoutes` **7 条 / 129 处**(`/products` 与 6 个方案详情;`lg:col-span-*` 挂在非 grid 父级)。
|
||||
- `wrappedNumberRoutes` **`/products/crm`、`/products/erp`,8 处**。
|
||||
- 已知 DEF-01 / DEF-02 均复现;细节见 §9。
|
||||
- 仪器边界:`/products/erp-upgrade-v3` 的区间指标文本异常(DEF-07)与满幅红面(DEF-06)在视觉上可见,但 sweep 的 `wrappedNumbers`/`gridGaps` 均未命中(选择器/底色条件不覆盖该组件);红像素判据只匹配 `#C41E3A ±28`,不匹配 `#8B1530`。
|
||||
|
||||
### 4.2 Admin 层(9 × 5 组合)
|
||||
|
||||
- **45 runs / 0 hard**;`opacity<0.99`、横向溢出、pageerror、console error 均为 **0**。
|
||||
- 登录成功;Dashboard 实测 16 模型 / 38 条目 / 6 区域 / 3 活跃用户 / 38 已发布;错误密码提示「用户名或密码错误」。
|
||||
- **DEF-03 复现**:390 档 **18/18** 运行出现公共 `mobile-tab-bar`(9 路由 × 明暗)。
|
||||
- **DEF-04 复现**:`/admin/content/news` 与 `/admin/users` 的 390 档标题/状态列逐字竖排;sweep 的 `clipping` 检测为 0(单元格无 `overflow:hidden`),以截图为准。
|
||||
- **P3**:45/45 运行至少命中 1 个 <44px 触控目标;拒绝态仍显示创建入口与表头;Dashboard 全部已读时「最近通知」显示空态;暗色活动项对比偏低。
|
||||
- 证据:`sweep/summary.json`、`contact-sheets/sweep-admin/`、`sweep/screenshots/admin/`。
|
||||
|
||||
## 5. 可访问性
|
||||
|
||||
- **axe run1:PASSED=true,EXIT=0**;35 路由 × 4 组合 = **140 rows**;`chromium/firefox × light/dark` 四组的 `violationNodes / contrastNodes / bgMismatch / themeMismatch / extraRulePagesUnderCovered` **全部为 0**;每页三条规则级通道分母 `105/105` 闭合;唯一 `non2xxResponses=1` 是 `/_not-found` 的正确 404。
|
||||
- **axe run2:PASSED=true,EXIT=0**;同一清单、同一命令的第二跑读数与 run1 完全一致(140 rows,四组全 0)。⇒ TA-05 修复后红绿可复现,不再是「失败集合漂移」。
|
||||
- **headings:EXIT=0**;`PAGES` 从 11 扩到 **34**,扫描 34 / 通过 34 / 失败 0 / 问题 0;`/_not-found` 按 404 契约不参与标题层级。证据 `heading-hierarchy-report.json`。
|
||||
- 静态层:`check:contrast` 44/44、`check:brand-token`、`check:a11y` 三条均 EXIT=0(见 §2)。
|
||||
|
||||
## 6. 功能 E2E
|
||||
|
||||
- **prod gate**(4 project,`@smoke|@critical|@journey`,副本库):**133 passed / 2 failed / 9 skipped / EXIT=1**。
|
||||
- 两红同因:`user-journey.spec.ts` 与 `mobile-user-journeys.spec.ts` 的 UJ-10 在点「公司新闻」后数到 2 条,第二条是**同一轮写库用例 UJ-03 刚创建的 `E2E 测试新闻`**;`/news` 的 ISR 缓存把这版缓存进了 `dist/standalone/dist/server/app/news.html`。
|
||||
- 隔离验证:新建干净副本库 + `npm run build` 清 ISR 缓存后单跑 UJ-10(desktop + mobile,`--workers=1`)⇒ **2 passed / EXIT=0**;串行 `user-journey.spec.ts`(含 UJ-03 写库与 UJ-10)⇒ **8 passed / EXIT=0**。⇒ 产品筛选逻辑正常,红因是**测试隔离/共享缓存污染**,登记为 TA-11。
|
||||
- 全量串行(4 project × 全部 spec,`--workers=1`)按实测速度需 3–4 小时,**已中止**(日志末尾标 `ABORTED_FULL_SERIAL`);改按三层取证:
|
||||
- **并行只读 spec**(22 个 spec,排除 `user-journey` / `mobile-user-journeys` / `cms-workflow` / 视觉):**1046 passed / 3 failed / 19 skipped / 10.3m / EXIT=1**。三红全部是 `website-acceptance.spec.ts` 的同一例「公司Logo可见且不被覆盖」(chromium-mobile / firefox / webkit):`logoBox.y=10` 与 `headerBox.y=29.936` 的取样竞态。2.5s 后独立几何探针实测 `header y=0 / h=80`、`logo y=10 / h=44`,四条包含关系全部成立 ⇒ **产品侧正确,红因是入场 transform 未落定时的取样**(TA-12)。
|
||||
- **移动旅程串行**:`mobile-user-journeys.spec.ts`(4 project,`--workers=1`,独立副本库)⇒ **20 passed / 0 failed / 2.7m / EXIT=0**。
|
||||
- **写库 CMS 串行**:`cms-workflow.spec.ts`(4 project,`--workers=1`,独立副本库)⇒ **3 passed / 9 skipped / EXIT=0**;9 skipped 为非 chromium project 的设计性跳过。
|
||||
- 另:`user-journey.spec.ts` 串行 **8 passed / EXIT=0**;UJ-10 隔离 **2 passed / EXIT=0**(见上)。
|
||||
- 跑后复核:`prisma/dev.db` 未被 E2E 写入(写库全部打 `/tmp` 副本)。
|
||||
|
||||
## 7. Lighthouse
|
||||
|
||||
- `npm run lighthouse` **EXIT=0**;11 URL × 3 run = **33/33 断言通过**。
|
||||
- 四类目中位数:performance **0.98–1.00**(仅首页 0.98)、accessibility / best-practices / SEO **全部 1.00**。
|
||||
- Core Web Vitals 中位数:FCP **245–329ms**、LCP **607–1184ms**、CLS **0**、TBT **0ms**、SI **245–327ms**。
|
||||
- 这是门禁固定 11 URL 的抽样,**不代表 35 页全量**;汇总见 `lighthouse/summary.json`。
|
||||
|
||||
## 8. 线上只读
|
||||
|
||||
- **35 路由 GET:34×200 + `/_not-found` 404(契约)**。
|
||||
- **8 次同口径渲染**(`/`、`/about`、`/contact`、`/products` × 1440/390):**hard=0 / 8**;opacity 乘积全为 1、`scrollWidth` 无横向溢出、`complete && naturalWidth=0` 的破图 **0**;console/pageerror 0;同源 4xx/5xx 0(`_rsc` 预取 abort 已单独排除)。
|
||||
- 懒加载图片在 5s 窗口内仍有 0–5 张 pending(`decode()` 未完成),逐 URL curl 均 200;登记为探针时序边界,不判破图。
|
||||
- **安全头:8/8 PASS**(CSP / HSTS / XFO / nosniff / Referrer / Permissions / XSS / ACAO)。
|
||||
- 线上仍是 `BUILD_ID=KO7S41-qvKY89xp5Kczbl`(2026-10-20 发布 `2f86c441`),**不等于当前 HEAD `03be1c9e`**;线上只作冒烟与版本对照,不作像素回归判据。
|
||||
|
||||
### 8.1 清单外的两个路由契约
|
||||
|
||||
- `/products/standalone/novavis`:本地与线上均 **307 → `https://novavis.p.novalon.cn`**(`generateStaticParams` 按 `externalUrl` 过滤,本地不渲染该页,属设计)。
|
||||
- Admin 既有条目编辑器:`/admin/content/news/cmsppk1wc008n1mndfjlu8g36` 登录后正常渲染,`h1=编辑新闻资讯`,标题/slug/摘要/日期/分类/图片/正文均回填;无 pageerror。控制台有 GA collect 被 CSP 拦截的报错,归入 DEF-09 的隐私/控制台噪声。
|
||||
|
||||
## 9. 缺陷
|
||||
|
||||
### 已知(2026-10-21 登记)复现情况
|
||||
|
||||
| ID | 状态 | 本轮读数 |
|
||||
|---|---|---|
|
||||
| DEF-01 P2 网格空槽 | **仍存在** | sweep `gridGapRoutes` **19 条 / 73 处**;本轮新增覆盖的 13 条路由(5 个产品详情、3 个服务详情、5 个方案详情)全部命中。源码:`products/product-detail-content-v3.tsx:232`(6 步/4 列)、`components/content/sections.tsx:355`(3 指标/4 列)、`components/detail/service-value.tsx:56`(5 项/3 列)、`solutions/solution-detail-content-v3.tsx:296-325`(5 列;`+` 与配套服务在 grid 外)。 |
|
||||
| DEF-02 P2 指标大字换行 | **仍存在** | `/products/erp` 3 条 + `/products/crm` 1 条 × 明暗 = **8 处**;实测 `81px` 字号、`209px` 内容宽、`lh=134`、`h=267`(两行)。源码 `components/content/sections.tsx:363`。 |
|
||||
| DEF-03 P2 公共 tab bar 泄漏到 Admin | **仍存在** | Admin `390` 档 **18/18** 命中(9 路由 × 明暗);`src/app/layout.tsx:218` 无条件渲染 `<MobileTabBar />`。截图 `sweep/screenshots/admin/*__390__*__hero.jpg`。 |
|
||||
| DEF-04 P2 Admin 移动端表格塌陷 | **仍存在** | `/admin/content/news` 390 档标题列逐字竖排、状态竖排;`/admin/users` 同型。sweep 的 `clipping` 检测为 0(单元格无 `overflow:hidden`),以截图为准。源码 `admin/content/[modelCode]/page.tsx:179-180`、`admin/users/page.tsx:289-290`。 |
|
||||
| DEF-05 P2 联系表单不在首屏 | **仍存在** | form top:**1064 @1440×900、1547 @834、1254 @390**;9 次运行全部 `inViewport=false`。 |
|
||||
|
||||
### 本轮新增
|
||||
|
||||
- **DEF-06 P2 满幅饱和红面回到 `/products/erp-upgrade-v3`**:`DetailCTASection` 使用 `bg-brand-section`(`src/components/detail/detail-cta-section.tsx:24`),被 `src/app/(marketing)/products/erp-upgrade-v3/page.tsx:75` 使用;实测 1440×842、y=4018,占整页高度约 **14.4%**。ADR-0008 把「饱和红用作面 = 0」作为对标语法,首页 FounderQuote 已因此删除;`home-content-v16.tsx:34` 的「全站唯一」注释已与现状不符。全站扫描仅此 1 条路由命中;`/products/standalone/[id]/client.tsx:270` 也使用该组件(当前 novavis 走外链,未渲染)。现有红像素判据只匹配 `#C41E3A ±28`,**不匹配 `#8B1530`**,所以自动 sweep 没报。
|
||||
- **DEF-07 P2 V3 区间指标被解析成 `36-个月` / `36`**:CMS 原值 `3-6个月`。`MetricCard` 用 `value.replace(/[^0-9.]/g,'')` 得 `36`、`suffix` 得 `-个月` ⇒ `36-个月`(`components/detail/detail-product-value.tsx:69-70`);同页 `DetailTrustSection` 的本地 `AnimatedCounter` 用 `^([^\d.]*)[\d.]+([^\d.]*)$` 匹配失败 ⇒ 只显示 `36`(`detail-trust-section.tsx:31-38`)。同一指标在相距约 500px 的两块里出现两种错误文本。
|
||||
- **DEF-09 P2 拒绝 / 未选择 analytics 时 GA4 仍发送 collect**:`GoogleAnalytics.tsx:95-96` 把 `analytics_storage` 默认写死为 `'granted'`,`GoogleAnalyticsWrapper` 在根布局全局挂载(`src/app/layout.tsx:205`,含 `/admin`);实测「无偏好 / analytics:false / analytics:true」三情景各发出 **3 个** GA 请求(`gtag/js` + 2×`google-analytics.com/g/collect`)。Cookie 横幅的 analytics 开关未作用于 gtag consent,属隐私/合规缺陷(非视觉)。证据 `visual/ga-consent-probe.json`。
|
||||
- **DEF-08 P3 V3 同一组指标重复渲染两次**:`ProductValueSection` 的「以可量化的目标约束交付」与 `DetailTrustSection` 的「以设计目标约束交付,在首批共创中转为可核验数据」渲染同一组 3 条 dataProofs(仅标题不同),页面出现重复内容。
|
||||
- **仪器缺口 TA-06**:红像素占比判据只数 `#C41E3A`,漏 `bg-brand-section #8B1530`;「面积 ≤10%」不能只看该读数。
|
||||
- **仪器缺口 TA-07**:`prisma/dev.db` 的 sha256 会因 WAL checkpoint 变化;指纹守卫需同时比对逻辑行数/最新时间戳(见 §1)。
|
||||
- **仪器缺口 TA-08**:sweep 的 `gridGaps` / `wrappedNumbers` 未覆盖 V3 的两处指标组件;`_rsc` 预取 abort 会进入原始 `failedRequests`,汇总时须单独分离。
|
||||
- **仪器缺口 TA-11(E2E 隔离)**:并行 gate 中 UJ-03 写库创建 `E2E 测试新闻`,UJ-10 同时在「公司新闻」筛选后数到 2 条;`/news` 的 ISR 缓存被写进 `dist/standalone/dist/server/app/news.html`,后续干净库复跑仍会读到。修法:写库 spec 串行/独立库,或在 UJ-10 断言前限定到种子 slug;本轮以「清缓存 + 干净库 + 串行」取得 2 passed。
|
||||
- **仪器缺口 TA-12(Logo 取样竞态)**:`website-acceptance.spec.ts` 的 Logo 包含断言在入场 transform 未落定时取样,读到 `header y=29.936`;2.5s 后几何探针实测 `header y=0 / h=80`、`logo y=10 / h=44`,四条包含关系成立。修法:`pollBoundingBox` 增加连续稳定帧或等 transition 结束。
|
||||
- **仪器缺口 TA-13(线上探针 lazy 图)**:`prod-readonly` 的 `complete` 判据会把 lazy-load 未完成误判为破图;已改为 `decode()` + `complete && naturalWidth=0`,并单独记录 pending。
|
||||
- **覆盖缺口已修**:`check:headings` 原先只扫 11 页,本轮扩到 34 页;`check:axe` 的 settle 原先一次跳底,本轮改为逐屏 dwell + 等显影(TA-05)。
|
||||
|
||||
## 10. 未做 / 不可自动判
|
||||
|
||||
- 真机 iOS/Android、VoiceOver/NVDA 屏幕阅读器、显示器色差校准、真实邮件送达、生产库一致性。
|
||||
- Admin 像素基线(数据/登录态相关,本轮只做 sweep 5 组合 + 评审)。
|
||||
- webkit axe(现有 axe 矩阵只有 chromium + firefox)。
|
||||
- hover / 半透明 / 伪元素对比度、framer 运行时动效时长。
|
||||
- 产品修复:本轮只验收,不改产品源码。
|
||||
- 单命令全量 E2E 串行按实测速度需 3–4 小时,已中止;改用「并行只读 + 串行旅程 + 串行写库」覆盖(见 §6)。
|
||||
- 线上像素对照:线上仍是 `KO7S41…`(`2f86c441`),与当前 HEAD 不同,只做冒烟与版本对照。
|
||||
- `website-acceptance.spec.ts` 的 3 条 Logo 红为取样竞态(TA-12),未在本轮修改测试;以 2.5s 后的几何探针为产品侧证据。
|
||||
- Lighthouse 只覆盖门禁固定的 11 URL,不是 35 页全量。
|
||||
|
||||
## 11. 复跑命令
|
||||
|
||||
```bash
|
||||
# 构建 + 装配(postbuild 自动完成)
|
||||
npm run build
|
||||
|
||||
# 副本库
|
||||
sqlite3 prisma/dev.db ".backup '/tmp/novalon-qa-20261024/dev.db'"
|
||||
|
||||
# 本地服务
|
||||
set -a; source .env.local; set +a
|
||||
DATABASE_URL=file:/tmp/novalon-qa-20261024/dev.db \
|
||||
ENCRYPTION_SECRET="$NEXT_PUBLIC_ENCRYPTION_SECRET" \
|
||||
HOSTNAME=127.0.0.1 PORT=3100 node dist/standalone/server.js
|
||||
|
||||
# 路由清单
|
||||
BASE=http://127.0.0.1:3100 OUT=docs/acceptance/2026-10-24-full-qa/routes.xml \
|
||||
MANIFEST=dist/standalone/dist/server/app npm run check:axe:routes
|
||||
|
||||
# 视觉:只读复跑(不写基线)
|
||||
cd e2e
|
||||
E2E_TARGET=production DATABASE_URL=file:/tmp/novalon-qa-20261024/dev.db \
|
||||
ENCRYPTION_SECRET="$NEXT_PUBLIC_ENCRYPTION_SECRET" \
|
||||
npx playwright test visual-regression.spec.ts --update-snapshots=none
|
||||
|
||||
# 全路由 sweep
|
||||
BASE=http://127.0.0.1:3100 ROUTES=docs/acceptance/2026-10-24-full-qa/routes.xml \
|
||||
OUT=docs/acceptance/2026-10-24-full-qa/sweep MODE=both \
|
||||
node scripts/acceptance/sweep-routes.mjs
|
||||
```
|
||||
|
||||
证据:`logs/`、`baseline-manifest.json`、`contact-sheets/`、`sweep/`、`axe/`、`lighthouse/`、`prod-readonly/`、`visual/bg-brand-section.json`。
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,63 @@
|
||||
# 覆盖矩阵(2026-10-24)
|
||||
|
||||
- 公开页分母:`routes.json` = **35** 条(sitemap ∪ 预渲染 ∪ BFS)。
|
||||
- 像素基线:35 条 × 5 project;新增 100 张,工作树共 227 张。
|
||||
- Sweep:35 × 5 组合(chromium)+ firefox/webkit 抽样;Admin 9 × 5。
|
||||
- axe:chromium/firefox × light/dark,每页两遍(tag + rules)。
|
||||
- Lighthouse:门禁固定 11 URL(抽样,不是全站)。
|
||||
- E2E:按关键路径覆盖,不是逐路由像素级。
|
||||
- 清单外契约:/products/standalone/novavis 本地与线上均 307 → https://novavis.p.novalon.cn;Admin 既有条目编辑器 1 条(登录态,/admin/content/news/<id>)已验证渲染与字段回填。
|
||||
|
||||
## 公开页
|
||||
|
||||
| 路由 | 像素基线 | Sweep | axe | Lighthouse | E2E |
|
||||
|---|---|---|---|---|---|
|
||||
| `/` | 5/5 | 5/5 +4 跨引擎 | 4/4 | ✓ | 关键路径 |
|
||||
| `/_not-found` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/about` | 5/5 | 5/5 +4 跨引擎 | 4/4 | ✓ | 关键路径 |
|
||||
| `/about/brand` | 5/5 | 5/5 | 4/4 | ✓ | — |
|
||||
| `/cases` | 5/5 | 5/5 | 4/4 | ✓ | — |
|
||||
| `/contact` | 5/5 | 5/5 +4 跨引擎 | 4/4 | ✓ | 关键路径 |
|
||||
| `/insights` | 5/5 | 5/5 | 4/4 | ✓ | 关键路径 |
|
||||
| `/methodology` | 5/5 | 5/5 | 4/4 | — | 关键路径 |
|
||||
| `/news` | 5/5 | 5/5 | 4/4 | ✓ | 关键路径 |
|
||||
| `/news/company-founded` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/news/digital-transformation-solution` | 5/5 | 5/5 +4 跨引擎 | 4/4 | — | — |
|
||||
| `/privacy` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/products` | 5/5 | 5/5 +4 跨引擎 | 4/4 | ✓ | 关键路径 |
|
||||
| `/products/bi` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/products/cms` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/products/crm` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/products/erp` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/products/erp-upgrade` | 5/5 | 5/5 | 4/4 | ✓ | — |
|
||||
| `/products/erp-upgrade-v3` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/products/oa` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/products/sds` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/services` | 5/5 | 5/5 | 4/4 | ✓ | 关键路径 |
|
||||
| `/services/consulting` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/services/data` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/services/software` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/services/solutions` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/solutions` | 5/5 | 5/5 | 4/4 | — | 关键路径 |
|
||||
| `/solutions/education` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/solutions/finance` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/solutions/healthcare` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/solutions/logistics` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/solutions/manufacturing` | 5/5 | 5/5 | 4/4 | ✓ | — |
|
||||
| `/solutions/retail` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
| `/team` | 5/5 | 5/5 | 4/4 | — | 关键路径 |
|
||||
| `/terms` | 5/5 | 5/5 | 4/4 | — | — |
|
||||
|
||||
## Admin
|
||||
|
||||
| 路由 | Sweep 5 组合 | 390 tab bar | 像素基线 |
|
||||
|---|---|---|---|
|
||||
| `/admin/login` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin/content/news` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin/content/news/new` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin/media` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin/notifications` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin/roles` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin/users` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
| `/admin/zones` | 5/5 | 390 档 2/2 命中 | 无像素基线(数据/登录态) |
|
||||
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"cycle": "2026-10-24-fixes",
|
||||
"head": "03be1c9e362a7009465b2792eb2b5e498cf61f2a",
|
||||
"verdict": "conditional-pass",
|
||||
"fixedThisRound": [
|
||||
{ "id": "DEF-03", "detail": "MobileTabBarGate:/admin* 不渲染公共 tab bar;Admin 390 运行时 tabBar=false。" },
|
||||
{ "id": "DEF-04", "detail": "内容/用户表 min-w-[760px] + 关键列 nowrap;390 实测表格 760 / 容器 356,可横向滚动。" },
|
||||
{ "id": "DEF-06", "detail": "DetailCTASection 去 bg-brand-section,改中性 bg-bg-primary + 红按钮;V3 运行时 bgBrandSection=0、CTA 背景 rgb(255,255,255)。" },
|
||||
{ "id": "DEF-07", "detail": "metric-value 解析器保留 3-6个月;V3 运行时 3-6个月 1 次、36-个月/裸 36 均为 0。" },
|
||||
{ "id": "DEF-08", "detail": "V3 ProductValueSection showDataProofs=false;旧标题 0、新标题 1,指标只渲染一组。" },
|
||||
{ "id": "DEF-09", "detail": "GA consent 默认 denied + 存偏好回放 + /admin 不加载;运行时无偏好/拒绝 gcs=G100、同意 gcs=G101。" },
|
||||
{ "id": "TA-11", "detail": "UJ-10 断言限定两篇种子 slug;prod gate 135 passed / 0 failed。" },
|
||||
{ "id": "TA-12", "detail": "pollBoundingBox 连续 5 次稳定取样;Logo 3 project 3 passed。" }
|
||||
],
|
||||
"remaining": [
|
||||
{ "id": "DEF-01", "severity": "P2", "title": "网格空槽", "detail": "19 路由 / 73 处;布局分档,待设计裁定。" },
|
||||
{ "id": "DEF-02", "severity": "P2", "title": "指标大字换行", "detail": "/products/erp、/products/crm 8 处;待设计裁定。" },
|
||||
{ "id": "DEF-05", "severity": "P2", "title": "联系表单不在首屏", "detail": "1064/1547/1254;待设计裁定。" },
|
||||
{ "id": "P3-01", "severity": "P3", "title": "Admin 触控目标 <44px", "detail": "未在本轮范围。" },
|
||||
{ "id": "P3-02", "severity": "P3", "title": "Admin 拒绝态入口/表头", "detail": "未在本轮范围。" },
|
||||
{ "id": "P3-03", "severity": "P3", "title": "最近通知空态", "detail": "未在本轮范围。" },
|
||||
{ "id": "P3-04", "severity": "P3", "title": "Admin 暗色活动项对比", "detail": "未在本轮范围。" }
|
||||
],
|
||||
"residualNotes": [
|
||||
"DEF-09:拒绝时仍有 GA cookieless collect(gcs=G100),符合 GA consent mode;若要求同意前零请求,需改为同意后才注入脚本(独立裁定)。",
|
||||
"TA-14:firefox UJ-10 在并行 gate 中曾出现一次导航超时,隔离复跑 1 passed;登记为残余超时抖动。",
|
||||
"视觉复验:跑过写库 E2E 后必须先 npm run build 清 ISR 缓存,否则 /news 会因缓存中的 E2E 新闻假红(本轮 5/5 同型红,重建后 225/225 绿)。"
|
||||
],
|
||||
"readings": {
|
||||
"targetedTests": "169 passed",
|
||||
"fullUnit": "151 suites / 1830 tests passed; 89.6/88.25/88.28/89.6",
|
||||
"typecheck": "0 error",
|
||||
"typecheckE2E": "0 error",
|
||||
"lint": "0 error / 84 warning",
|
||||
"checkVisual": "EXIT=0",
|
||||
"checkMotion": "0 violations",
|
||||
"checkA11y": "EXIT=0; headings 34/34",
|
||||
"e2eProdGate": "135 passed / 0 failed / 9 skipped",
|
||||
"ga4TC001": "4 projects / 4 passed",
|
||||
"logo3Projects": "3 passed",
|
||||
"visual": "225 passed / 0 failed (after clean rebuild)",
|
||||
"v3Baselines": "5 re-taken and reviewed",
|
||||
"adminSweep": "45 runs / 0 hard / tabBarOn390=0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
{
|
||||
"cycle": "2026-10-24-full-qa",
|
||||
"head": "03be1c9e362a7009465b2792eb2b5e498cf61f2a",
|
||||
"buildId": "Es_G_8BY-bB9rpDpy0thO",
|
||||
"verdict": "conditional-pass",
|
||||
"counts": { "P0": 0, "P1": 0, "P2": 8, "P3": 5 },
|
||||
"defects": [
|
||||
{
|
||||
"id": "DEF-01",
|
||||
"severity": "P2",
|
||||
"type": "ui-layout",
|
||||
"title": "网格列数与内容量不匹配,产生可见空槽",
|
||||
"detail": "6 步放进 4 列、3 指标放进 4 列、5 项能力放进 3 列、2 产品放进 5 列(+ 与配套服务在 grid 外);空槽被 bg-border-primary 画成整块灰底。",
|
||||
"status": "still-present",
|
||||
"blastRadius": "19 条路由 / 73 处(sweep gridGapRoutes)",
|
||||
"routes": ["/products", "/products/bi", "/products/cms", "/products/crm", "/products/oa", "/products/sds", "/services", "/services/consulting", "/services/data", "/services/software", "/services/solutions", "/solutions", "/solutions/education", "/solutions/finance", "/solutions/healthcare", "/solutions/logistics", "/solutions/manufacturing", "/solutions/retail", "/products/erp"],
|
||||
"source": [
|
||||
"src/app/(marketing)/products/product-detail-content-v3.tsx:232",
|
||||
"src/components/content/sections.tsx:355",
|
||||
"src/components/detail/service-value.tsx:56",
|
||||
"src/app/(marketing)/solutions/solution-detail-content-v3.tsx:296-325"
|
||||
],
|
||||
"evidence": ["sweep/summary.json", "sweep/report.json", "contact-sheets/baselines/visual-chromium-desktop__full-02.jpg", "contact-sheets/baselines/visual-chromium-desktop__full-03.jpg"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-02",
|
||||
"severity": "P2",
|
||||
"type": "ui-typography",
|
||||
"title": "指标大字在 1440 宽度断行",
|
||||
"detail": "81px 字号落在 209px 内容宽里,line-height=134,实际高度 267(两行);40%+ / 99.2% / 3-6个月 / +113% 被拆行。",
|
||||
"status": "still-present",
|
||||
"blastRadius": "8 处(/products/erp 6、/products/crm 2)",
|
||||
"routes": ["/products/erp", "/products/crm"],
|
||||
"source": ["src/components/content/sections.tsx:363"],
|
||||
"evidence": ["sweep/report.json (wrappedNumbers)"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-03",
|
||||
"severity": "P2",
|
||||
"type": "ui-cross-route-leak",
|
||||
"title": "公共移动 tab bar 泄漏到 Admin",
|
||||
"detail": "根布局无条件渲染 MobileTabBar;/admin 与 /admin/login 及全部子页在 390 档显示「首页/行业/能力/洞察/联系」,fixed 覆盖 admin 内容。",
|
||||
"status": "still-present",
|
||||
"blastRadius": "9 个 admin 路由 / 390 档 18/18",
|
||||
"routes": ["/admin/login", "/admin", "/admin/content/news", "/admin/content/news/new", "/admin/media", "/admin/notifications", "/admin/roles", "/admin/users", "/admin/zones"],
|
||||
"source": ["src/app/layout.tsx:218"],
|
||||
"evidence": ["sweep/summary.json (admin.tabBarOn390=18)", "contact-sheets/sweep-admin/admin-390-light-chromium.jpg"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-04",
|
||||
"severity": "P2",
|
||||
"type": "ui-responsive",
|
||||
"title": "Admin 移动端表格塌陷",
|
||||
"detail": "390 档内容列表标题列逐字竖排、状态签竖排;用户管理表同样压缩;外层 overflow-x-auto + table w-full 只压缩不横向滚动。",
|
||||
"status": "still-present",
|
||||
"blastRadius": "/admin/content/*、/admin/users 等表格页 390 档",
|
||||
"routes": ["/admin/content/news", "/admin/users"],
|
||||
"source": ["src/app/admin/content/[modelCode]/page.tsx:179-180", "src/app/admin/users/page.tsx:289-290"],
|
||||
"evidence": ["contact-sheets/sweep-admin/admin-390-light-chromium.jpg", "sweep/screenshots/admin/admin-content_news__390__light__chromium__full.webp"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-05",
|
||||
"severity": "P2",
|
||||
"type": "ue-above-the-fold",
|
||||
"title": "联系表单不在首屏",
|
||||
"detail": "form top:1064 @1440×900、1547 @834、1254 @390;9 次运行全部 inViewport=false。DESIGN.md 称 contact 为紧凑档、表单回首屏。",
|
||||
"status": "still-present",
|
||||
"blastRadius": "/contact 全视口",
|
||||
"routes": ["/contact"],
|
||||
"source": ["src/app/(marketing)/contact/contact-content-v3.tsx"],
|
||||
"evidence": ["sweep/summary.json (form.contact)", "contact-sheets/baselines/visual-chromium-desktop__full-01.jpg"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-06",
|
||||
"severity": "P2",
|
||||
"type": "design-grammar",
|
||||
"title": "满幅饱和红面回到 /products/erp-upgrade-v3",
|
||||
"detail": "DetailCTASection 使用 bg-brand-section #8B1530;实测 1440×842、y=4018,占整页高度约 14.4%。ADR-0008 明确「饱和红用作面 = 0」,首页 FounderQuote 已因此删除;全站扫描仅此 1 条路由命中。",
|
||||
"status": "new",
|
||||
"blastRadius": "1 条路由;/products/standalone/[id]/client.tsx 也使用该组件(当前 novavis 外链未渲染)",
|
||||
"routes": ["/products/erp-upgrade-v3"],
|
||||
"source": ["src/components/detail/detail-cta-section.tsx:24", "src/app/(marketing)/products/erp-upgrade-v3/page.tsx:75", "src/app/(marketing)/home-content-v16.tsx:34 (已过时的「全站唯一」注释)"],
|
||||
"evidence": ["visual/bg-brand-section.json", "visual/v3-metrics-crop.png", "contact-sheets/baselines/visual-chromium-desktop__full-03.jpg", "docs/adr/0008-benchmark-grammar-takeover.md:24"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-07",
|
||||
"severity": "P2",
|
||||
"type": "content-rendering",
|
||||
"title": "V3 区间指标 3-6个月 被解析成 36-个月 / 36",
|
||||
"detail": "CMS 原值 3-6个月。MetricCard 用 value.replace(/[^0-9.]/g,'') 得 36、suffix 得 -个月 ⇒ 36-个月;同页 DetailTrustSection 的本地 AnimatedCounter 用 ^([^\\d.]*)[\\d.]+([^\\d.]*)$ 匹配失败 ⇒ 只显示 36。同一指标在两块里出现两种错误文本,区间语义丢失。",
|
||||
"status": "new",
|
||||
"blastRadius": "1 条路由 × 2 个指标区块 × 5 project",
|
||||
"routes": ["/products/erp-upgrade-v3"],
|
||||
"source": ["src/components/detail/detail-product-value.tsx:69-70", "src/components/detail/detail-trust-section.tsx:31-38", "prisma/seeds/products.ts:27"],
|
||||
"evidence": ["visual/v3-metrics-crop.png", "visual/v3-second-metric-crop.png", "contact-sheets/baselines/visual-chromium-desktop__full-03.jpg"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-09",
|
||||
"severity": "P2",
|
||||
"type": "privacy-consent",
|
||||
"title": "拒绝 / 未选择 analytics 时 GA4 仍发送 collect",
|
||||
"detail": "GoogleAnalytics 的 consent 默认写死 analytics_storage: 'granted'(src/components/analytics/GoogleAnalytics.tsx:95-96),GoogleAnalyticsWrapper 又在根布局全局挂载(src/app/layout.tsx:205,含 /admin)。实测三种情景(无偏好 / analytics:false / analytics:true)各发出 3 个 GA 请求:gtag/js + 两条 google-analytics.com/g/collect。Cookie 横幅的 analytics 开关未作用于 gtag consent。",
|
||||
"status": "new",
|
||||
"blastRadius": "全站(含 /admin);拒绝分析的用户仍被采集",
|
||||
"routes": ["全站", "/admin"],
|
||||
"source": ["src/components/analytics/GoogleAnalytics.tsx:95-96", "src/components/analytics/GoogleAnalyticsWrapper.tsx:10", "src/app/layout.tsx:205"],
|
||||
"evidence": ["visual/ga-consent-probe.json", "visual/admin-editor-existing.json"]
|
||||
},
|
||||
{
|
||||
"id": "DEF-08",
|
||||
"severity": "P3",
|
||||
"type": "content-duplication",
|
||||
"title": "V3 同一组 dataProofs 重复渲染两次",
|
||||
"detail": "ProductValueSection 的「以可量化的目标约束交付」与 DetailTrustSection 的「以设计目标约束交付,在首批共创中转为可核验数据」渲染同一组 3 条指标与描述,仅标题不同。",
|
||||
"status": "new",
|
||||
"blastRadius": "1 条路由",
|
||||
"routes": ["/products/erp-upgrade-v3"],
|
||||
"source": ["src/components/detail/detail-product-value.tsx:249-287", "src/components/detail/detail-trust-section.tsx:111-158"],
|
||||
"evidence": ["visual/v3-metrics-crop.png"]
|
||||
},
|
||||
{
|
||||
"id": "P3-01",
|
||||
"severity": "P3",
|
||||
"type": "a11y-touch-target",
|
||||
"title": "Admin 触控目标 <44px",
|
||||
"detail": "sweep 45/45 admin 运行至少命中 1 个 <44px 目标;示例:密码可见性 16×16、菜单 28×28、登录按钮高 43。",
|
||||
"status": "still-present",
|
||||
"routes": ["/admin/login", "/admin"],
|
||||
"evidence": ["sweep/summary.json (admin.touchUnder44Runs=45)"]
|
||||
},
|
||||
{
|
||||
"id": "P3-02",
|
||||
"severity": "P3",
|
||||
"type": "ui-permission-state",
|
||||
"title": "Admin 拒绝态仍显示创建入口与表头",
|
||||
"detail": "e2e_editor 直访 /admin/users 时,仅横幅提示无权限,但「创建用户」按钮与表头仍在。",
|
||||
"status": "still-present",
|
||||
"routes": ["/admin/users"],
|
||||
"evidence": ["sweep/notes.adminPermissionDenied", "sweep/screenshots/admin/admin-permission-denied__1440__light__chromium__full.webp"]
|
||||
},
|
||||
{
|
||||
"id": "P3-03",
|
||||
"severity": "P3",
|
||||
"type": "ui-empty-state",
|
||||
"title": "Dashboard「最近通知」全部已读时显示暂无通知",
|
||||
"detail": "160+ 条通知全部已读时,面板名为「最近通知」却显示空态;本轮 163 条通知、未读 0,实测「暂无通知」。",
|
||||
"status": "still-present",
|
||||
"routes": ["/admin"],
|
||||
"evidence": ["sweep/notes.adminLogin.bodySnippet", "contact-sheets/sweep-admin/admin-1440-light-chromium.jpg"]
|
||||
},
|
||||
{
|
||||
"id": "P3-04",
|
||||
"severity": "P3",
|
||||
"type": "ui-dark-contrast",
|
||||
"title": "Admin 暗色活动项对比偏低",
|
||||
"detail": "侧栏当前项在深底上的深色块对比偏低;axe 不计入 violation(axe 只扫前台路由),按人工评审登记。",
|
||||
"status": "still-present",
|
||||
"routes": ["/admin"],
|
||||
"evidence": ["contact-sheets/sweep-admin/admin-1440-dark-chromium.jpg"]
|
||||
}
|
||||
],
|
||||
"instrument": [
|
||||
{ "id": "TA-05", "status": "fixed-this-round", "detail": "axe settle 改为逐屏 260ms + 双 rAF + 等 main 内 inline opacity:0 清零;run1 35×4=140 rows 全 0。" },
|
||||
{ "id": "TA-06", "status": "open", "detail": "红像素占比只匹配 #C41E3A ±28,漏 bg-brand-section #8B1530;不能单靠该读数判「红面 ≤10%」。" },
|
||||
{ "id": "TA-07", "status": "open", "detail": "prisma/dev.db 的 sha256 会因 WAL checkpoint 变化;指纹守卫需同时比对逻辑行数与最新时间戳。" },
|
||||
{ "id": "TA-08", "status": "open", "detail": "sweep 的 gridGaps/wrappedNumbers 未覆盖 V3 的两处指标组件;_rsc 预取 abort 进入原始 failedRequests,汇总须分离。" },
|
||||
{ "id": "TA-09", "status": "fixed-this-round", "detail": "check:headings 从 11 页扩到 34 页;/_not-found 按 404 契约排除。" },
|
||||
{ "id": "TA-10", "status": "intentional", "detail": "Admin 不建像素基线(数据/登录态相关),由 sweep 5 组合 + 评审覆盖。" },
|
||||
{ "id": "TA-11", "status": "open", "detail": "并行 gate 中 UJ-03 写库创建 E2E 测试新闻,UJ-10 同时筛选到 2 条;/news 的 ISR 缓存被写入 dist/standalone/dist/server/app/news.html,后续干净库复跑仍会读到。修法:写库 spec 串行/独立库,或 UJ-10 限定种子 slug。本轮清缓存 + 干净库 + 串行后 2 passed。" },
|
||||
{ "id": "TA-12", "status": "open", "detail": "website-acceptance.spec.ts 的 Logo 包含断言在入场 transform 未落定时取样,读到 header y=29.936;2.5s 后探针实测 header y=0 / h=80、logo y=10 / h=44,几何合法。修法:pollBoundingBox 增加连续稳定帧或等 transition 结束。" },
|
||||
{ "id": "TA-13", "status": "fixed-in-probe", "detail": "prod-readonly 的 complete 判据会把 lazy-load 未完成误判为破图;已改为 decode() + complete && naturalWidth=0,并单独记录 pending。" }
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,149 @@
|
||||
{
|
||||
"generatedAt": "2026-10-23T19:03:14.331Z",
|
||||
"runs": 33,
|
||||
"urls": [
|
||||
{
|
||||
"url": "/",
|
||||
"runs": 3,
|
||||
"performance": 0.98,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 246,
|
||||
"lcp": 1184,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 280
|
||||
},
|
||||
{
|
||||
"url": "/about",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 327,
|
||||
"lcp": 687,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 327
|
||||
},
|
||||
{
|
||||
"url": "/about/brand",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 245,
|
||||
"lcp": 607,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 245
|
||||
},
|
||||
{
|
||||
"url": "/cases",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 327,
|
||||
"lcp": 707,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 327
|
||||
},
|
||||
{
|
||||
"url": "/contact",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 329,
|
||||
"lcp": 816,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 329
|
||||
},
|
||||
{
|
||||
"url": "/insights",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 245,
|
||||
"lcp": 626,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 246
|
||||
},
|
||||
{
|
||||
"url": "/news",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 245,
|
||||
"lcp": 649,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 245
|
||||
},
|
||||
{
|
||||
"url": "/products",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 245,
|
||||
"lcp": 625,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 245
|
||||
},
|
||||
{
|
||||
"url": "/products/erp-upgrade",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 245,
|
||||
"lcp": 625,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 245
|
||||
},
|
||||
{
|
||||
"url": "/services",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 245,
|
||||
"lcp": 608,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 279
|
||||
},
|
||||
{
|
||||
"url": "/solutions/manufacturing",
|
||||
"runs": 3,
|
||||
"performance": 1,
|
||||
"accessibility": 1,
|
||||
"bestPractices": 1,
|
||||
"seo": 1,
|
||||
"fcp": 245,
|
||||
"lcp": 625,
|
||||
"cls": 0,
|
||||
"tbt": 0,
|
||||
"si": 286
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"prevCount": 35,
|
||||
"curCount": 35,
|
||||
"added": [],
|
||||
"removed": []
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"generatedAt": "2026-10-23T17:25:47.231Z",
|
||||
"count": 35,
|
||||
"routes": [
|
||||
"/",
|
||||
"/_not-found",
|
||||
"/about",
|
||||
"/about/brand",
|
||||
"/cases",
|
||||
"/contact",
|
||||
"/insights",
|
||||
"/methodology",
|
||||
"/news",
|
||||
"/news/company-founded",
|
||||
"/news/digital-transformation-solution",
|
||||
"/privacy",
|
||||
"/products",
|
||||
"/products/bi",
|
||||
"/products/cms",
|
||||
"/products/crm",
|
||||
"/products/erp",
|
||||
"/products/erp-upgrade",
|
||||
"/products/erp-upgrade-v3",
|
||||
"/products/oa",
|
||||
"/products/sds",
|
||||
"/services",
|
||||
"/services/consulting",
|
||||
"/services/data",
|
||||
"/services/software",
|
||||
"/services/solutions",
|
||||
"/solutions",
|
||||
"/solutions/education",
|
||||
"/solutions/finance",
|
||||
"/solutions/healthcare",
|
||||
"/solutions/logistics",
|
||||
"/solutions/manufacturing",
|
||||
"/solutions/retail",
|
||||
"/team",
|
||||
"/terms"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url><loc>http://127.0.0.1:3100/</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/_not-found</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/about</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/about/brand</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/cases</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/contact</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/insights</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/methodology</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/news</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/news/company-founded</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/news/digital-transformation-solution</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/privacy</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/bi</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/cms</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/crm</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/erp</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/erp-upgrade</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/erp-upgrade-v3</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/oa</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/products/sds</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/services</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/services/consulting</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/services/data</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/services/software</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/services/solutions</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/solutions</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/solutions/education</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/solutions/finance</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/solutions/healthcare</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/solutions/logistics</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/solutions/manufacturing</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/solutions/retail</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/team</loc></url>
|
||||
<url><loc>http://127.0.0.1:3100/terms</loc></url>
|
||||
</urlset>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,277 @@
|
||||
{
|
||||
"meta": {
|
||||
"base": "http://127.0.0.1:3100",
|
||||
"startedAt": "2026-10-23T17:52:33.267Z",
|
||||
"routesFile": "/Users/zhangxiang/Codes/Novalon/novalon-website/docs/acceptance/2026-10-24-full-qa/routes.xml",
|
||||
"matrix": [
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "light"
|
||||
},
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "dark"
|
||||
},
|
||||
{
|
||||
"vp": "834",
|
||||
"theme": "light"
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "light"
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "dark"
|
||||
}
|
||||
],
|
||||
"routes": [
|
||||
"/",
|
||||
"/_not-found",
|
||||
"/about",
|
||||
"/about/brand",
|
||||
"/cases",
|
||||
"/contact",
|
||||
"/insights",
|
||||
"/methodology",
|
||||
"/news",
|
||||
"/news/company-founded",
|
||||
"/news/digital-transformation-solution",
|
||||
"/privacy",
|
||||
"/products",
|
||||
"/products/bi",
|
||||
"/products/cms",
|
||||
"/products/crm",
|
||||
"/products/erp",
|
||||
"/products/erp-upgrade",
|
||||
"/products/erp-upgrade-v3",
|
||||
"/products/oa",
|
||||
"/products/sds",
|
||||
"/services",
|
||||
"/services/consulting",
|
||||
"/services/data",
|
||||
"/services/software",
|
||||
"/services/solutions",
|
||||
"/solutions",
|
||||
"/solutions/education",
|
||||
"/solutions/finance",
|
||||
"/solutions/healthcare",
|
||||
"/solutions/logistics",
|
||||
"/solutions/manufacturing",
|
||||
"/solutions/retail",
|
||||
"/team",
|
||||
"/terms"
|
||||
],
|
||||
"routeCount": 35,
|
||||
"finishedAt": "2026-10-23T18:05:49.494Z"
|
||||
},
|
||||
"public": {
|
||||
"runs": 195,
|
||||
"hard": 0,
|
||||
"opacityBelow099": 0,
|
||||
"overflowX": 0,
|
||||
"brokenImages": 0,
|
||||
"pageErrors": 0,
|
||||
"consoleErrorRuns": 5,
|
||||
"prefetchAbortRuns": 160,
|
||||
"sameOriginHttpErrorRuns": 0,
|
||||
"otherNetworkFailureRuns": 0,
|
||||
"thirdPartyRuns": 157,
|
||||
"routes": 35
|
||||
},
|
||||
"detectors": {
|
||||
"wrappedNumberRoutes": [
|
||||
"/products/crm",
|
||||
"/products/erp"
|
||||
],
|
||||
"gridGapRoutes": [
|
||||
"/products",
|
||||
"/products/bi",
|
||||
"/products/cms",
|
||||
"/products/crm",
|
||||
"/products/erp",
|
||||
"/products/oa",
|
||||
"/products/sds",
|
||||
"/services",
|
||||
"/services/consulting",
|
||||
"/services/data",
|
||||
"/services/software",
|
||||
"/services/solutions",
|
||||
"/solutions",
|
||||
"/solutions/education",
|
||||
"/solutions/finance",
|
||||
"/solutions/healthcare",
|
||||
"/solutions/logistics",
|
||||
"/solutions/manufacturing",
|
||||
"/solutions/retail"
|
||||
],
|
||||
"orphanColSpanRoutes": [
|
||||
"/products",
|
||||
"/solutions/education",
|
||||
"/solutions/finance",
|
||||
"/solutions/healthcare",
|
||||
"/solutions/logistics",
|
||||
"/solutions/manufacturing",
|
||||
"/solutions/retail"
|
||||
],
|
||||
"wrappedOccurrences": 8,
|
||||
"gridGapOccurrences": 73,
|
||||
"orphanOccurrences": 129
|
||||
},
|
||||
"design": {
|
||||
"redTouchMin": 1,
|
||||
"redTouchMax": 80,
|
||||
"redPixelRatioTop": [
|
||||
{
|
||||
"route": "/_not-found",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0437
|
||||
},
|
||||
{
|
||||
"route": "/_not-found",
|
||||
"vp": "390",
|
||||
"theme": "dark",
|
||||
"p": 0.0435
|
||||
},
|
||||
{
|
||||
"route": "/terms",
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"p": 0.026
|
||||
},
|
||||
{
|
||||
"route": "/terms",
|
||||
"vp": "834",
|
||||
"theme": "light",
|
||||
"p": 0.0254
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0249
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "dark",
|
||||
"p": 0.0249
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0249
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0246
|
||||
},
|
||||
{
|
||||
"route": "/terms",
|
||||
"vp": "1440",
|
||||
"theme": "dark",
|
||||
"p": 0.0244
|
||||
},
|
||||
{
|
||||
"route": "/",
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"p": 0.0233
|
||||
}
|
||||
],
|
||||
"redPixelRatioRuleNote": "matches brand #C41E3A +/-28 only; bg-brand-section #8B1530 is not counted"
|
||||
},
|
||||
"form": {
|
||||
"contact": [
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "dark",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "834",
|
||||
"theme": "light",
|
||||
"top": 1547,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"top": 1254,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "dark",
|
||||
"top": 1254,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"top": 1255,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "1440",
|
||||
"theme": "light",
|
||||
"top": 1064,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
},
|
||||
{
|
||||
"vp": "390",
|
||||
"theme": "light",
|
||||
"top": 1254,
|
||||
"inViewport": false,
|
||||
"fields": 6
|
||||
}
|
||||
]
|
||||
},
|
||||
"admin": {
|
||||
"runs": 45,
|
||||
"hard": 0,
|
||||
"opacityBelow099": 0,
|
||||
"overflowX": 0,
|
||||
"tabBarOn390": 18,
|
||||
"tabBarRoutes": [
|
||||
"/admin/login",
|
||||
"/admin",
|
||||
"/admin/content/news",
|
||||
"/admin/content/news/new",
|
||||
"/admin/media",
|
||||
"/admin/notifications",
|
||||
"/admin/roles",
|
||||
"/admin/users",
|
||||
"/admin/zones"
|
||||
],
|
||||
"pageErrors": 0,
|
||||
"consoleErrorRuns": 0,
|
||||
"touchUnder44Runs": 45
|
||||
},
|
||||
"hardList": []
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
// 2026-10-24 新增视觉基线的清单 + 拼版工具(只读 e2e/visual-snapshots,只在证据目录写产物)
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import crypto from 'crypto';
|
||||
import sharp from 'sharp';
|
||||
|
||||
const ROOT = '/Users/zhangxiang/Codes/Novalon/novalon-website';
|
||||
const EV = path.join(ROOT, 'docs/acceptance/2026-10-24-full-qa');
|
||||
const SNAP = path.join(ROOT, 'e2e/visual-snapshots');
|
||||
const OUT = path.join(EV, 'contact-sheets/baselines');
|
||||
fs.mkdirSync(OUT, { recursive: true });
|
||||
|
||||
const PROJECTS = [
|
||||
'visual-chromium-desktop',
|
||||
'visual-chromium-tablet',
|
||||
'visual-chromium-mobile',
|
||||
'visual-firefox-desktop',
|
||||
'visual-webkit-desktop',
|
||||
];
|
||||
|
||||
const ROUTES = [
|
||||
['not-found', '/_not-found'],
|
||||
['cases', '/cases'],
|
||||
['insights', '/insights'],
|
||||
['news-digital-transformation', '/news/digital-transformation-solution'],
|
||||
['privacy', '/privacy'],
|
||||
['terms', '/terms'],
|
||||
['product-bi', '/products/bi'],
|
||||
['product-cms', '/products/cms'],
|
||||
['product-crm', '/products/crm'],
|
||||
['product-oa', '/products/oa'],
|
||||
['product-sds', '/products/sds'],
|
||||
['product-erp-upgrade-v3', '/products/erp-upgrade-v3'],
|
||||
['service-consulting', '/services/consulting'],
|
||||
['service-data', '/services/data'],
|
||||
['service-solutions', '/services/solutions'],
|
||||
['solution-education', '/solutions/education'],
|
||||
['solution-finance', '/solutions/finance'],
|
||||
['solution-healthcare', '/solutions/healthcare'],
|
||||
['solution-logistics', '/solutions/logistics'],
|
||||
['solution-retail', '/solutions/retail'],
|
||||
];
|
||||
|
||||
const sha256 = (buf) => crypto.createHash('sha256').update(buf).digest('hex');
|
||||
const esc = (s) => s.replace(/[<>&'"]/g, (c) => ({ '<': '<', '>': '>', '&': '&', "'": ''', '"': '"' }[c]));
|
||||
|
||||
const manifest = [];
|
||||
for (const project of PROJECTS) {
|
||||
for (const [name, route] of ROUTES) {
|
||||
const file = path.join(SNAP, project, 'visual-regression.spec.ts', `${name}-fullpage-${project}.png`);
|
||||
if (!fs.existsSync(file)) {
|
||||
manifest.push({ project, name, route, file, exists: false });
|
||||
continue;
|
||||
}
|
||||
const buf = fs.readFileSync(file);
|
||||
const meta = await sharp(buf).metadata();
|
||||
const stats = await sharp(buf).stats();
|
||||
const channels = stats.channels.slice(0, 3);
|
||||
const stdev = Math.max(...channels.map((c) => c.stdev));
|
||||
const entropy = Math.max(...channels.map((c) => c.entropy));
|
||||
manifest.push({
|
||||
project,
|
||||
name,
|
||||
route,
|
||||
file: path.relative(ROOT, file),
|
||||
exists: true,
|
||||
width: meta.width,
|
||||
height: meta.height,
|
||||
bytes: buf.length,
|
||||
sha256: sha256(buf),
|
||||
maxChannelStdev: +stdev.toFixed(2),
|
||||
maxChannelEntropy: +entropy.toFixed(3),
|
||||
blankSuspicion: stdev < 6 || entropy < 1.2,
|
||||
});
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(path.join(EV, 'baseline-manifest.json'), JSON.stringify(manifest, null, 2));
|
||||
console.log(`manifest=${manifest.length} missing=${manifest.filter((m) => !m.exists).length} blankSuspicion=${manifest.filter((m) => m.blankSuspicion).length}`);
|
||||
|
||||
async function labeledTile(file, width, cropTop) {
|
||||
let src = await sharp(file).resize({ width, withoutEnlargement: true }).jpeg({ quality: 80 }).toBuffer();
|
||||
let m = await sharp(src).metadata();
|
||||
if (cropTop && m.height > cropTop) {
|
||||
src = await sharp(src).extract({ left: 0, top: 0, width: m.width, height: cropTop }).jpeg({ quality: 80 }).toBuffer();
|
||||
m = await sharp(src).metadata();
|
||||
}
|
||||
const label = Buffer.from(
|
||||
`<svg width="${m.width}" height="24" xmlns="http://www.w3.org/2000/svg">`
|
||||
+ `<rect width="${m.width}" height="24" fill="#fff"/>`
|
||||
+ `<text x="4" y="16" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#111">${esc(path.basename(file).replace('-fullpage-' + path.basename(path.dirname(path.dirname(file))) + '.png', ''))}</text></svg>`,
|
||||
);
|
||||
return {
|
||||
buf: await sharp({ create: { width: m.width, height: m.height + 24, channels: 3, background: '#fff' } })
|
||||
.composite([{ input: src, top: 0, left: 0 }, { input: label, top: m.height, left: 0 }])
|
||||
.jpeg({ quality: 82 }).toBuffer(),
|
||||
height: m.height + 24,
|
||||
};
|
||||
}
|
||||
|
||||
async function sheet(files, out, width, cols, cropTop) {
|
||||
const tiles = [];
|
||||
for (const f of files) tiles.push(await labeledTile(f, width, cropTop));
|
||||
const rows = [];
|
||||
for (let i = 0; i < tiles.length; i += cols) rows.push(tiles.slice(i, i + cols));
|
||||
const gap = 8;
|
||||
const heights = rows.map((r) => Math.max(...r.map((t) => t.height)));
|
||||
const w = cols * width + (cols - 1) * gap;
|
||||
const h = heights.reduce((a, b) => a + b, 0) + (rows.length - 1) * gap;
|
||||
const comps = [];
|
||||
let y = 0;
|
||||
rows.forEach((r, ri) => {
|
||||
let x = 0;
|
||||
r.forEach((t) => { comps.push({ input: t.buf, top: y, left: x }); x += width + gap; });
|
||||
y += heights[ri] + gap;
|
||||
});
|
||||
await sharp({ create: { width: w, height: h, channels: 3, background: '#fff' } })
|
||||
.composite(comps).jpeg({ quality: 80 }).toFile(out);
|
||||
console.log(`sheet ${path.basename(out)} ${files.length} tiles ${w}x${h}`);
|
||||
}
|
||||
|
||||
for (const project of PROJECTS) {
|
||||
const files = ROUTES.map(([name]) => path.join(SNAP, project, 'visual-regression.spec.ts', `${name}-fullpage-${project}.png`)).filter(fs.existsSync);
|
||||
await sheet(files, path.join(OUT, `${project}__top.jpg`), 300, 5, 900);
|
||||
for (let i = 0; i < files.length; i += 5) {
|
||||
await sheet(files.slice(i, i + 5), path.join(OUT, `${project}__full-${String(i / 5 + 1).padStart(2, '0')}.jpg`), 300, 5, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// 生成 35 公开 + 9 Admin 的覆盖矩阵(读取本轮证据,不重新跑任何东西)。
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const EV = process.env.EV || 'docs/acceptance/2026-10-24-full-qa';
|
||||
const routes = JSON.parse(fs.readFileSync(path.join(EV, 'routes.json'), 'utf8')).routes;
|
||||
const baselines = JSON.parse(fs.readFileSync(path.join(EV, 'baseline-manifest.json'), 'utf8'));
|
||||
const sweep = JSON.parse(fs.readFileSync(path.join(EV, 'sweep/report.json'), 'utf8'));
|
||||
const axe = JSON.parse(fs.readFileSync(path.join(EV, 'axe/run1/axe-evidence.json'), 'utf8'));
|
||||
const lh = JSON.parse(fs.readFileSync('config/test/lighthouserc.json', 'utf8')).ci.collect.url.map((u) => new URL(u).pathname);
|
||||
|
||||
const visualByRoute = new Map();
|
||||
for (const b of baselines) {
|
||||
if (!b.exists) continue;
|
||||
if (!visualByRoute.has(b.route)) visualByRoute.set(b.route, new Set());
|
||||
visualByRoute.get(b.route).add(b.project);
|
||||
}
|
||||
const sweepByRoute = new Map();
|
||||
for (const r of sweep.runs) {
|
||||
if (!sweepByRoute.has(r.route)) sweepByRoute.set(r.route, { combos: 0, extra: 0, hard: 0 });
|
||||
const x = sweepByRoute.get(r.route);
|
||||
if (r.engine === 'chromium') x.combos += 1;
|
||||
else x.extra += 1;
|
||||
if (r.hardFailure) x.hard += 1;
|
||||
}
|
||||
const axeByRoute = new Map();
|
||||
for (const r of axe.rows) {
|
||||
if (!axeByRoute.has(r.url)) axeByRoute.set(r.url, { combos: 0, violations: 0, contrast: 0 });
|
||||
const x = axeByRoute.get(r.url);
|
||||
x.combos += 1;
|
||||
x.violations += r.violationNodes;
|
||||
x.contrast += r.contrastNodes;
|
||||
}
|
||||
const e2eRoutes = new Set(['/', '/about', '/contact', '/products', '/solutions', '/services', '/news', '/insights', '/team', '/methodology']);
|
||||
|
||||
const rows = routes.map((route) => {
|
||||
const s = sweepByRoute.get(route) || { combos: 0, extra: 0, hard: 0 };
|
||||
const a = axeByRoute.get(route) || { combos: 0, violations: 0, contrast: 0 };
|
||||
return `| \`${route}\` | 5/5 | ${s.combos}/5${s.extra ? ` +${s.extra} 跨引擎` : ''}${s.hard ? ` · hard ${s.hard}` : ''} | ${a.combos}/4${a.violations ? ` · ${a.violations} nodes` : ''} | ${lh.includes(route) ? '✓' : '—'} | ${e2eRoutes.has(route) ? '关键路径' : '—'} |`;
|
||||
}).join('\n');
|
||||
|
||||
const adminRoutes = [...new Set((sweep.adminRuns || []).map((r) => r.route))];
|
||||
const adminRows = adminRoutes.map((route) => {
|
||||
const rs = (sweep.adminRuns || []).filter((r) => r.route === route);
|
||||
const hard = rs.filter((r) => r.hardFailure).length;
|
||||
const tab = rs.filter((r) => r.viewport === '390' && r.mobileTabBar).length;
|
||||
return `| \`${route}\` | ${rs.length}/5${hard ? ` · hard ${hard}` : ''} | ${tab ? `390 档 ${tab}/2 命中` : '—'} | 无像素基线(数据/登录态) |`;
|
||||
}).join('\n');
|
||||
|
||||
const md = `# 覆盖矩阵(2026-10-24)
|
||||
|
||||
- 公开页分母:\`routes.json\` = **${routes.length}** 条(sitemap ∪ 预渲染 ∪ BFS)。
|
||||
- 像素基线:35 条 × 5 project;新增 100 张,工作树共 227 张。
|
||||
- Sweep:35 × 5 组合(chromium)+ firefox/webkit 抽样;Admin 9 × 5。
|
||||
- axe:chromium/firefox × light/dark,每页两遍(tag + rules)。
|
||||
- Lighthouse:门禁固定 11 URL(抽样,不是全站)。
|
||||
- E2E:按关键路径覆盖,不是逐路由像素级。
|
||||
- 清单外契约:/products/standalone/novavis 本地与线上均 307 → https://novavis.p.novalon.cn;Admin 既有条目编辑器 1 条(登录态,/admin/content/news/<id>)已验证渲染与字段回填。
|
||||
|
||||
## 公开页
|
||||
|
||||
| 路由 | 像素基线 | Sweep | axe | Lighthouse | E2E |
|
||||
|---|---|---|---|---|---|
|
||||
${rows}
|
||||
|
||||
## Admin
|
||||
|
||||
| 路由 | Sweep 5 组合 | 390 tab bar | 像素基线 |
|
||||
|---|---|---|---|
|
||||
${adminRows}
|
||||
`;
|
||||
fs.writeFileSync(path.join(EV, 'coverage-matrix.md'), md);
|
||||
console.log(md);
|
||||
@@ -0,0 +1,117 @@
|
||||
// 线上只读验收:35 条公开路由 GET + 8 次同口径渲染。不登录、不 POST、不写任何远端状态。
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { chromium } from 'playwright';
|
||||
|
||||
const BASE = (process.env.BASE || 'https://www.novalon.cn').replace(/\/$/, '');
|
||||
const OUT = process.env.OUT || 'docs/acceptance/2026-10-24-full-qa/prod-readonly';
|
||||
const ROUTES = JSON.parse(fs.readFileSync(process.env.ROUTES_JSON || 'docs/acceptance/2026-10-24-full-qa/routes.json', 'utf8')).routes;
|
||||
fs.mkdirSync(path.join(OUT, 'screenshots'), { recursive: true });
|
||||
|
||||
const report = { base: BASE, startedAt: new Date().toISOString(), http: [], render: [] };
|
||||
|
||||
for (const route of ROUTES) {
|
||||
const started = Date.now();
|
||||
try {
|
||||
const res = await fetch(BASE + route, { redirect: 'follow', signal: AbortSignal.timeout(30000) });
|
||||
const body = await res.text();
|
||||
const title = (body.match(/<title[^>]*>([\s\S]*?)<\/title>/i) || [])[1]?.trim() || '';
|
||||
const h1 = (body.match(/<h1[^>]*>([\s\S]*?)<\/h1>/i) || [])[1]?.replace(/<[^>]+>/g, '').trim() || '';
|
||||
report.http.push({
|
||||
route, status: res.status, finalUrl: res.url, ms: Date.now() - started,
|
||||
bytes: body.length, title: title.slice(0, 160), h1: h1.slice(0, 160),
|
||||
cache: res.headers.get('x-nextjs-cache') || '', server: res.headers.get('server') || '',
|
||||
});
|
||||
} catch (err) {
|
||||
report.http.push({ route, status: 0, error: String(err).slice(0, 300), ms: Date.now() - started });
|
||||
}
|
||||
console.log(`[http] ${route} ${report.http.at(-1).status} ${report.http.at(-1).ms}ms`);
|
||||
}
|
||||
|
||||
const browser = await chromium.launch();
|
||||
const targets = ['/', '/about', '/contact', '/products'];
|
||||
for (const route of targets) {
|
||||
for (const vp of [{ w: 1440, h: 900, name: '1440' }, { w: 390, h: 844, name: '390', mobile: true }]) {
|
||||
const ctx = await browser.newContext({
|
||||
viewport: { width: vp.w, height: vp.h },
|
||||
...(vp.mobile ? { isMobile: true, hasTouch: true, deviceScaleFactor: 2 } : {}),
|
||||
reducedMotion: 'reduce',
|
||||
});
|
||||
const page = await ctx.newPage();
|
||||
const consoleErrors = [];
|
||||
const pageErrors = [];
|
||||
const failed = [];
|
||||
page.on('console', (m) => { if (m.type() === 'error') consoleErrors.push(m.text().slice(0, 200)); });
|
||||
page.on('pageerror', (e) => pageErrors.push(String(e).slice(0, 200)));
|
||||
page.on('requestfailed', (r) => failed.push({ url: r.url().slice(0, 160), err: r.failure()?.errorText }));
|
||||
page.on('response', (r) => {
|
||||
if (r.status() >= 400 && new URL(r.url()).origin === new URL(BASE).origin) failed.push({ url: r.url().slice(0, 160), status: r.status() });
|
||||
});
|
||||
const started = Date.now();
|
||||
let metrics = null;
|
||||
let error = null;
|
||||
try {
|
||||
await page.goto(BASE + route, { waitUntil: 'domcontentloaded', timeout: 45000 });
|
||||
await page.waitForTimeout(1200);
|
||||
await page.evaluate(() => document.querySelectorAll('img').forEach((img) => { img.loading = 'eager'; }));
|
||||
await page.evaluate(async () => {
|
||||
const step = Math.max(400, Math.floor(window.innerHeight * 0.8));
|
||||
for (let y = 0; y <= document.body.scrollHeight; y += step) {
|
||||
window.scrollTo(0, y);
|
||||
await new Promise((r) => setTimeout(r, 260));
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
await new Promise((r) => setTimeout(r, 400));
|
||||
});
|
||||
// decode() 会等图片真正可用;lazy-load 下 complete 标志不可靠,不能单凭它判破图。
|
||||
await page.evaluate(async () => {
|
||||
await Promise.race([
|
||||
Promise.all([...document.images].map((img) => img.decode().catch(() => null))),
|
||||
new Promise((r) => setTimeout(r, 15000)),
|
||||
]);
|
||||
}).catch(() => {});
|
||||
await page.evaluate(() => document.fonts?.ready).catch(() => {});
|
||||
await page.waitForTimeout(800);
|
||||
metrics = await page.evaluate(() => {
|
||||
let el = document.querySelector('main');
|
||||
let op = 1;
|
||||
while (el) { op *= parseFloat(getComputedStyle(el).opacity || '1'); el = el.parentElement; }
|
||||
const iw = window.innerWidth;
|
||||
const overflowX = document.documentElement.scrollWidth > iw + 1;
|
||||
const overflowElements = [...document.querySelectorAll('body *')].filter((n) => {
|
||||
const r = n.getBoundingClientRect();
|
||||
const s = getComputedStyle(n);
|
||||
if (!(r.width > 0 && r.height > 0 && s.display !== 'none' && s.visibility !== 'hidden')) return false;
|
||||
// 跳过链接等 intentional off-screen 元素(完全在视口左侧)不算横向溢出。
|
||||
return (r.right > iw + 1 && r.left < iw) || (r.left < -1 && r.right > 0);
|
||||
}).slice(0, 5).map((n) => ({ tag: n.tagName, cls: String(n.className).slice(0, 80) }));
|
||||
const images = [...document.images].filter((i) => i.currentSrc || i.src);
|
||||
const broken = images.filter((i) => i.complete && i.naturalWidth === 0).map((i) => (i.currentSrc || i.src).slice(0, 160));
|
||||
const pendingImages = images.filter((i) => !i.complete).map((i) => (i.currentSrc || i.src).slice(0, 160));
|
||||
return {
|
||||
opacityProduct: +op.toFixed(4), overflowX, overflowElements, broken, pendingImages,
|
||||
h1: (document.querySelector('h1')?.textContent || '').trim().slice(0, 160),
|
||||
title: document.title.slice(0, 160),
|
||||
};
|
||||
});
|
||||
await page.screenshot({ path: path.join(OUT, 'screenshots', `${route === '/' ? 'home' : route.replace(/^\//, '').replace(/\//g, '_')}__${vp.name}.png`), fullPage: true }).catch(() => {});
|
||||
} catch (err) {
|
||||
error = String(err).slice(0, 300);
|
||||
}
|
||||
const isRscAbort = (x) => /[?&]_rsc=/.test(x.url || '') && x.err === 'net::ERR_ABORTED';
|
||||
const sameOriginFailed = failed.filter((x) => !isRscAbort(x) && (x.status >= 400 || x.err));
|
||||
report.render.push({
|
||||
route, viewport: vp.name, ms: Date.now() - started, metrics, error,
|
||||
consoleErrors, pageErrors, sameOriginFailed,
|
||||
hard: Boolean(error) || !metrics || metrics.opacityProduct < 0.99 || metrics.overflowX || metrics.broken.length > 0 || pageErrors.length > 0 || sameOriginFailed.length > 0,
|
||||
});
|
||||
console.log(`[render] ${route} ${vp.name} hard=${report.render.at(-1).hard}`);
|
||||
await ctx.close();
|
||||
}
|
||||
}
|
||||
await browser.close();
|
||||
report.finishedAt = new Date().toISOString();
|
||||
report.hardCount = report.render.filter((r) => r.hard).length;
|
||||
fs.writeFileSync(path.join(OUT, 'report.json'), JSON.stringify(report, null, 2));
|
||||
console.log(`DONE http=${report.http.length} render=${report.render.length} hard=${report.hardCount}`);
|
||||
process.exit(report.hardCount > 0 ? 1 : 0);
|
||||
@@ -0,0 +1,36 @@
|
||||
// 全站 bg-brand-section 扫描:量化“满幅饱和红面”在哪些路由仍存在。
|
||||
// 只读 3100 本地产物;不截图、不写远端。
|
||||
import fs from 'fs';
|
||||
import { chromium } from 'playwright';
|
||||
|
||||
const BASE = (process.env.BASE || 'http://127.0.0.1:3100').replace(/\/$/, '');
|
||||
const EV = process.env.EV || 'docs/acceptance/2026-10-24-full-qa';
|
||||
const routes = JSON.parse(fs.readFileSync(`${EV}/routes.json`, 'utf8')).routes;
|
||||
const browser = await chromium.launch();
|
||||
const page = await browser.newPage({ viewport: { width: 1440, height: 900 }, reducedMotion: 'reduce' });
|
||||
const out = [];
|
||||
for (const route of routes) {
|
||||
await page.goto(BASE + route, { waitUntil: 'domcontentloaded', timeout: 45000 });
|
||||
await page.waitForTimeout(400);
|
||||
const found = await page.evaluate(() => {
|
||||
const els = [...document.querySelectorAll('.bg-brand-section, [class*="bg-brand-section"]')];
|
||||
const docH = document.documentElement.scrollHeight || 1;
|
||||
return els.map((el) => {
|
||||
const r = el.getBoundingClientRect();
|
||||
const s = getComputedStyle(el);
|
||||
return {
|
||||
tag: el.tagName,
|
||||
cls: String(el.className || '').slice(0, 160),
|
||||
text: (el.innerText || '').trim().slice(0, 80),
|
||||
w: Math.round(r.width), h: Math.round(r.height), top: Math.round(r.top + window.scrollY),
|
||||
opacity: s.opacity, bg: s.backgroundColor,
|
||||
pageRatio: +(r.width * r.height / (window.innerWidth * docH)).toFixed(4),
|
||||
};
|
||||
});
|
||||
});
|
||||
out.push({ route, count: found.length, elements: found });
|
||||
console.log(`${route} count=${found.length} ${found.map((f) => `${f.w}x${f.h}@${f.top}`).join(' ')}`);
|
||||
}
|
||||
await browser.close();
|
||||
fs.writeFileSync(`${EV}/visual/bg-brand-section.json`, JSON.stringify(out, null, 2));
|
||||
console.log('DONE routes=' + out.length + ' hits=' + out.filter((x) => x.count > 0).length);
|
||||
@@ -0,0 +1,75 @@
|
||||
// 汇总 sweep report.json(只读),产物写 evidence 目录。
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const EV = process.env.EV || 'docs/acceptance/2026-10-24-full-qa';
|
||||
const report = JSON.parse(fs.readFileSync(path.join(EV, 'sweep/report.json'), 'utf8'));
|
||||
const runs = report.runs || [];
|
||||
const admin = report.adminRuns || [];
|
||||
|
||||
const uniq = (xs) => [...new Set(xs)];
|
||||
const isRscAbort = (x) => /[?&]_rsc=/.test(x.url || '') && x.error === 'net::ERR_ABORTED';
|
||||
const isHttpError = (x) => typeof x.status === 'number' && x.status >= 400;
|
||||
const publicSummary = {
|
||||
runs: runs.length,
|
||||
hard: runs.filter((r) => r.hardFailure).length,
|
||||
opacityBelow099: runs.filter((r) => (r.opacityProduct ?? 1) < 0.99).length,
|
||||
overflowX: runs.filter((r) => r.overflowX).length,
|
||||
brokenImages: runs.filter((r) => (r.broken || []).length > 0).length,
|
||||
pageErrors: runs.filter((r) => (r.pageErrors || []).length > 0).length,
|
||||
consoleErrorRuns: runs.filter((r) => (r.consoleErrors || []).length > 0).length,
|
||||
// `_rsc` 预取在导航/滚动时被浏览器 abort 是 Next 的正常噪声,不算失败请求。
|
||||
prefetchAbortRuns: runs.filter((r) => (r.failedRequests || []).some(isRscAbort)).length,
|
||||
sameOriginHttpErrorRuns: runs.filter((r) => (r.failedRequests || []).some((x) => isHttpError(x) && !(r.expected404 && /\/_not-found$/.test(x.url || '')))).length,
|
||||
otherNetworkFailureRuns: runs.filter((r) => (r.failedRequests || []).some((x) => !isRscAbort(x) && !isHttpError(x))).length,
|
||||
thirdPartyRuns: runs.filter((r) => (r.thirdParty || []).length > 0).length,
|
||||
routes: uniq(runs.map((r) => r.route)).length,
|
||||
};
|
||||
|
||||
const detectors = {
|
||||
wrappedNumberRoutes: uniq(runs.filter((r) => (r.wrappedNumbers || []).length > 0).map((r) => r.route)),
|
||||
gridGapRoutes: uniq(runs.filter((r) => (r.gridGaps || []).length > 0).map((r) => r.route)),
|
||||
orphanColSpanRoutes: uniq(runs.filter((r) => (r.orphanColSpans || []).length > 0).map((r) => r.route)),
|
||||
wrappedOccurrences: runs.reduce((n, r) => n + (r.wrappedNumbers || []).length, 0),
|
||||
gridGapOccurrences: runs.reduce((n, r) => n + (r.gridGaps || []).length, 0),
|
||||
orphanOccurrences: runs.reduce((n, r) => n + (r.orphanColSpans || []).length, 0),
|
||||
};
|
||||
|
||||
const redRows = runs
|
||||
.filter((r) => r.shots && typeof r.shots.redPixelRatio === 'number')
|
||||
.map((r) => ({ route: r.route, vp: r.viewport, theme: r.theme, p: r.shots.redPixelRatio }))
|
||||
.sort((a, b) => b.p - a.p)
|
||||
.slice(0, 10);
|
||||
|
||||
const design = {
|
||||
redTouchMin: Math.min(...runs.map((r) => r.redTouches ?? 0)),
|
||||
redTouchMax: Math.max(...runs.map((r) => r.redTouches ?? 0)),
|
||||
redPixelRatioTop: redRows,
|
||||
// 这条判据只匹配 #C41E3A ±28;bg-brand-section(#8B1530) 不在范围内 —— 见 README 的仪器缺口。
|
||||
redPixelRatioRuleNote: 'matches brand #C41E3A +/-28 only; bg-brand-section #8B1530 is not counted',
|
||||
};
|
||||
|
||||
const form = { contact: [] };
|
||||
for (const r of runs.filter((x) => x.route === '/contact')) {
|
||||
if (r.form) form.contact.push({ vp: r.viewport, theme: r.theme, top: r.form.top, inViewport: r.form.inFirstViewport, fields: r.form.fields });
|
||||
}
|
||||
|
||||
const adminSummary = {
|
||||
runs: admin.length,
|
||||
hard: admin.filter((r) => r.hardFailure).length,
|
||||
opacityBelow099: admin.filter((r) => (r.opacityProduct ?? 1) < 0.99).length,
|
||||
overflowX: admin.filter((r) => r.overflowX).length,
|
||||
tabBarOn390: admin.filter((r) => r.viewport === '390' && r.mobileTabBar).length,
|
||||
tabBarRoutes: uniq(admin.filter((r) => r.viewport === '390' && r.mobileTabBar).map((r) => r.route)),
|
||||
pageErrors: admin.filter((r) => (r.pageErrors || []).length > 0).length,
|
||||
consoleErrorRuns: admin.filter((r) => (r.consoleErrors || []).length > 0).length,
|
||||
touchUnder44Runs: admin.filter((r) => (r.touchTargets || []).some((t) => t.w < 44 || t.h < 44)).length,
|
||||
};
|
||||
|
||||
const hardList = [...runs, ...admin]
|
||||
.filter((r) => r.hardFailure)
|
||||
.map((r) => ({ kind: r.kind, route: r.route, vp: r.viewport, theme: r.theme, error: r.error, opacity: r.opacityProduct, overflowX: r.overflowX, broken: (r.broken || []).length, pageErrors: (r.pageErrors || []).length, failedRequests: (r.failedRequests || []).length }));
|
||||
|
||||
const out = { meta: report.meta, public: publicSummary, detectors, design, form, admin: adminSummary, hardList };
|
||||
fs.writeFileSync(path.join(EV, 'sweep/summary.json'), JSON.stringify(out, null, 2));
|
||||
console.log(JSON.stringify(out, null, 2));
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"info": {
|
||||
"url": "/admin/content/news/cmsppk1wc008n1mndfjlu8g36",
|
||||
"title": "四川睿新致远科技有限公司 - 企业数字化转型服务商",
|
||||
"h1": "编辑新闻资讯",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "text",
|
||||
"value": "四川睿新致远科技有限公司正式成立"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": "text",
|
||||
"value": "company-founded"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": "textarea",
|
||||
"value": "2026年1月15日,四川睿新致远科技有限公司在成都龙泉驿区正式成立,标志着公司"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": "text",
|
||||
"value": "2026-01-15"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": "text",
|
||||
"value": "公司新闻"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": "text",
|
||||
"value": "/images/news/founding.webp"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": "textarea",
|
||||
"value": "2026年1月15日,四川睿新致远科技有限公司在成都龙泉驿区幸福路12号正式成立"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": "checkbox",
|
||||
"value": "on"
|
||||
}
|
||||
],
|
||||
"buttons": [
|
||||
"",
|
||||
"内容管理",
|
||||
"页面管理",
|
||||
"页面配置",
|
||||
"资源管理",
|
||||
"系统管理",
|
||||
"通知",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"Connecting to 'https://www.google.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za200zd9245722638xf1&_p=1792782931895&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1110059625&_eu=AAAAAGQ&are=1&cid=1605357745.1792782933&frm=0&pscdl=denied&rcb=6&sr=1440x900&uaa=arm&uab=64&uafvl=Chromium%3B148.0.7778.96%7CHeadlessChrome%3B148.0.7778.96%7CNot%252FA)Brand%3B99.0.0.0&uam=&uamb=0&uap=macOS&uapv=27.0.1&uaw=0&ul=en-us&gaf=3&_s=8&tag_exp=115938466~115938469~118897920~118897930~120213116~120385422~120469145~120469153~121246026~121246034&sid=1792782932&sct=1&seg=1&dl=http%3A%2F%2F127.0.0.1%2Fadmin&dr=http%3A%2F%2F127.0.0.1%3A3100%2Fadmin%2Flogin&dt=%E5%9B%9B%E5%B7%9D%E7%9D%BF%E6%96%B0%E8%87%B4%E8%BF%9C%E7%A7%91%E6%8A%80%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8%20-%20%E4%BC%81%E4%B8%9A%E6%95%B0%E5%AD%97%E5%8C%96%E8%BD%AC%E5%9E%8B%E6%9C%8D%E5%8A%A1%E5%95%86&_tu=QAg&en=user_engagement&ep.anonymize_ip=true&_et=1431&tfd=4189' violates the following Content Security Policy directive: \"connect-src 'self' https://www.google-analytics.com https://ssl.google-analytics.com https://www.googletagmanager.com\". The action has been blocked.",
|
||||
"Fetch API cannot load https://www.google.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za200zd9245722638xf1&_p=1792782931895&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1110059625&_eu=AAAAAGQ&are=1&cid=1605357745.1792782933&frm=0&pscdl=denied&rcb=6&sr=1440x900&uaa=arm&uab=64&uafvl=Chromium%3B148.0.7778.96%7CHeadlessChrome%3B148.0.7778.96%7CNot%252FA)Brand%3B99.0.0.0&uam=&uamb=0&uap=macOS&uapv=27.0.1&uaw=0&ul=en-us&gaf=3&_s=8&tag_exp=115938466~115938469~118897920~118897930~120213116~120385422~120469145~120469153~121246026~121246034&sid=1792782932&sct=1&seg=1&dl=http%3A%2F%2F127.0.0.1%2Fadmin&dr=http%3A%2F%2F127.0.0.1%3A3100%2Fadmin%2Flogin&dt=%E5%9B%9B%E5%B7%9D%E7%9D%BF%E6%96%B0%E8%87%B4%E8%BF%9C%E7%A7%91%E6%8A%80%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8%20-%20%E4%BC%81%E4%B8%9A%E6%95%B0%E5%AD%97%E5%8C%96%E8%BD%AC%E5%9E%8B%E6%9C%8D%E5%8A%A1%E5%95%86&_tu=QAg&en=user_engagement&ep.anonymize_ip=true&_et=1431&tfd=4189. Refused to connect because it violates the document's Content Security Policy."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
[
|
||||
{
|
||||
"route": "/admin/content/news",
|
||||
"tabBar": false,
|
||||
"table": {
|
||||
"w": 760,
|
||||
"h": 193
|
||||
},
|
||||
"wrap": {
|
||||
"w": 356,
|
||||
"h": 193
|
||||
},
|
||||
"tableScrollWidth": 760,
|
||||
"wrapClientWidth": 356,
|
||||
"wrapScrollWidth": 760,
|
||||
"cell": {
|
||||
"w": 270,
|
||||
"h": 72
|
||||
},
|
||||
"cellWhiteSpace": "nowrap",
|
||||
"cellText": "四川睿新致远科技有限公司正式成立"
|
||||
},
|
||||
{
|
||||
"route": "/admin/users",
|
||||
"tabBar": false,
|
||||
"table": {
|
||||
"w": 760,
|
||||
"h": 207
|
||||
},
|
||||
"wrap": {
|
||||
"w": 356,
|
||||
"h": 207
|
||||
},
|
||||
"tableScrollWidth": 760,
|
||||
"wrapClientWidth": 356,
|
||||
"wrapScrollWidth": 760,
|
||||
"cell": {
|
||||
"w": 160,
|
||||
"h": 53
|
||||
},
|
||||
"cellWhiteSpace": "nowrap",
|
||||
"cellText": "e2e_reviewer"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,189 @@
|
||||
[
|
||||
{
|
||||
"route": "/",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/_not-found",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/about",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/about/brand",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/cases",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/contact",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/insights",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/methodology",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/news",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/news/company-founded",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/news/digital-transformation-solution",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/privacy",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products/bi",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products/cms",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products/crm",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products/erp",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products/erp-upgrade",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products/erp-upgrade-v3",
|
||||
"count": 1,
|
||||
"elements": [
|
||||
{
|
||||
"tag": "SECTION",
|
||||
"cls": "relative py-24 sm:py-32 md:py-40 overflow-hidden bg-brand-section",
|
||||
"text": "免费咨询\n探索 睿新ERP管理系统 的无限可能\n\n立即联系我们,获取专属方案和报价\n\n预约咨询\n\n工作日 2 小时内回复您的咨询 · 首次沟通后,给出问题梳理与",
|
||||
"w": 1440,
|
||||
"h": 842,
|
||||
"top": 4018,
|
||||
"opacity": "1",
|
||||
"bg": "rgb(139, 21, 48)",
|
||||
"pageRatio": 0.1441
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"route": "/products/oa",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/products/sds",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/services",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/services/consulting",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/services/data",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/services/software",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/services/solutions",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/solutions",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/solutions/education",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/solutions/finance",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/solutions/healthcare",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/solutions/logistics",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/solutions/manufacturing",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/solutions/retail",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/team",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
},
|
||||
{
|
||||
"route": "/terms",
|
||||
"count": 0,
|
||||
"elements": []
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"base": "http://127.0.0.1:3100",
|
||||
"scenarios": [
|
||||
{
|
||||
"label": "no-preference",
|
||||
"prefs": null,
|
||||
"count": 3,
|
||||
"gcs": [
|
||||
"G100"
|
||||
],
|
||||
"consent": [
|
||||
[
|
||||
"consent",
|
||||
"default",
|
||||
{
|
||||
"analytics_storage": "denied",
|
||||
"ad_storage": "denied",
|
||||
"functionality_storage": "granted",
|
||||
"personalization_storage": "denied",
|
||||
"security_storage": "granted",
|
||||
"wait_for_update": 500
|
||||
}
|
||||
],
|
||||
[
|
||||
"consent",
|
||||
"update",
|
||||
{
|
||||
"analytics_storage": "denied",
|
||||
"ad_storage": "denied",
|
||||
"functionality_storage": "denied"
|
||||
}
|
||||
]
|
||||
],
|
||||
"requests": [
|
||||
"https://www.googletagmanager.com/gtag/js?id=G-LGTLCR15KM",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za208zd9245722638xf1&_p=1792795844984&gcs=G100&gcd=13q3q3l3l7l1&npa=1&dma=0&ecid=972761888&_e",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za200zd9245722638xf1&_p=1792795844984&gcs=G100&gcd=13q3q3l3l7l1&npa=1&dma=0&ecid=972761888&_e"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "analytics-false",
|
||||
"prefs": {
|
||||
"necessary": true,
|
||||
"analytics": false,
|
||||
"marketing": false,
|
||||
"functionality": true,
|
||||
"timestamp": 1784284000000
|
||||
},
|
||||
"count": 3,
|
||||
"gcs": [
|
||||
"G100"
|
||||
],
|
||||
"consent": [
|
||||
[
|
||||
"consent",
|
||||
"default",
|
||||
{
|
||||
"analytics_storage": "denied",
|
||||
"ad_storage": "denied",
|
||||
"functionality_storage": "granted",
|
||||
"personalization_storage": "denied",
|
||||
"security_storage": "granted",
|
||||
"wait_for_update": 500
|
||||
}
|
||||
],
|
||||
[
|
||||
"consent",
|
||||
"update",
|
||||
{
|
||||
"analytics_storage": "denied",
|
||||
"ad_storage": "denied",
|
||||
"functionality_storage": "granted"
|
||||
}
|
||||
]
|
||||
],
|
||||
"requests": [
|
||||
"https://www.googletagmanager.com/gtag/js?id=G-LGTLCR15KM",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za208zd9245722638xf1&_p=1792795850275&gcs=G100&gcd=13q3q3l3l7l1&npa=1&dma=0&ecid=15044662&_eu",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za200zd9245722638xf1&_p=1792795850275&gcs=G100&gcd=13q3q3l3l7l1&npa=1&dma=0&ecid=15044662&_eu"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "analytics-true",
|
||||
"prefs": {
|
||||
"necessary": true,
|
||||
"analytics": true,
|
||||
"marketing": false,
|
||||
"functionality": true,
|
||||
"timestamp": 1784284000000
|
||||
},
|
||||
"count": 3,
|
||||
"gcs": [
|
||||
"G101"
|
||||
],
|
||||
"consent": [
|
||||
[
|
||||
"consent",
|
||||
"default",
|
||||
{
|
||||
"analytics_storage": "denied",
|
||||
"ad_storage": "denied",
|
||||
"functionality_storage": "granted",
|
||||
"personalization_storage": "denied",
|
||||
"security_storage": "granted",
|
||||
"wait_for_update": 500
|
||||
}
|
||||
],
|
||||
[
|
||||
"consent",
|
||||
"update",
|
||||
{
|
||||
"analytics_storage": "granted",
|
||||
"ad_storage": "denied",
|
||||
"functionality_storage": "granted"
|
||||
}
|
||||
]
|
||||
],
|
||||
"requests": [
|
||||
"https://www.googletagmanager.com/gtag/js?id=G-LGTLCR15KM",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1h1v9245722638za208zd9245722638xf1&_p=1792795855467&gcs=G101&gcd=13q3r3l3l7l1&npa=1&dma=0&ecid=1991191400",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1h1v9245722638za200zd9245722638xf1&_p=1792795855467&gcs=G101&gcd=13q3r3l3l7l1&npa=1&dma=0&ecid=1991191400"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"base": "http://127.0.0.1:3100",
|
||||
"scenarios": [
|
||||
{
|
||||
"label": "no-preference",
|
||||
"prefs": null,
|
||||
"count": 3,
|
||||
"requests": [
|
||||
"https://www.googletagmanager.com/gtag/js?id=G-LGTLCR15KM",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6am0h2v9245722638za208zd9245722638xf1&_p=1792783023891&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1042691346",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6am0h2v9245722638za200zd9245722638xf1&_p=1792783023891&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1042691346"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "analytics-false",
|
||||
"prefs": {
|
||||
"necessary": true,
|
||||
"analytics": false,
|
||||
"marketing": false,
|
||||
"functionality": true,
|
||||
"timestamp": 1784284000000
|
||||
},
|
||||
"count": 3,
|
||||
"requests": [
|
||||
"https://www.googletagmanager.com/gtag/js?id=G-LGTLCR15KM",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6am0h2v9245722638za208zd9245722638xf1&_p=1792783029042&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1567457302",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6am0h2v9245722638za200zd9245722638xf1&_p=1792783029042&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1567457302"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "analytics-true",
|
||||
"prefs": {
|
||||
"necessary": true,
|
||||
"analytics": true,
|
||||
"marketing": false,
|
||||
"functionality": true,
|
||||
"timestamp": 1784284000000
|
||||
},
|
||||
"count": 3,
|
||||
"requests": [
|
||||
"https://www.googletagmanager.com/gtag/js?id=G-LGTLCR15KM",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za208zd9245722638xf1&_p=1792783034216&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1636712146&_",
|
||||
"https://www.google-analytics.com/g/collect?v=2&tid=G-LGTLCR15KM>m=45je6al1v9245722638za200zd9245722638xf1&_p=1792783034216&gcs=G101&gcd=13p3t3l3l7l1&npa=1&dma=0&ecid=1636712146&_"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"bgBrandSection": 0,
|
||||
"ctaBg": "rgb(255, 255, 255)",
|
||||
"ctaText": "探索 睿新ERP管理系统 的无限可能",
|
||||
"rangeCount": 0,
|
||||
"badHyphen": 0,
|
||||
"oldTitle": 0,
|
||||
"newTitle": 1,
|
||||
"metricSnippet": "行业\n能力\n洞察\n关于我们\n预约咨询\n企业旗舰系列\n睿新ERP管理系统\n\n打通财务、采购、销售、库存、生产全链路,让各部门数据实时流转、业务流程自动协同。\n\n睿新ERP管理系统是面向企业打造的一体化资源管理平台,打通财务、采购、销售、库存、生产等核心模块,让各部门数据实时流转、业务流程自动协同,帮助企业告别信息孤岛。\n\n预约咨询\n查看方案\n产品功能\n睿新ERP管理系统 核心能力\n\n睿新ERP管理系"
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,73 @@
|
||||
// 把 sweep 产出的 hero 截图拼成 contact sheet,便于逐页人工/vision 过目。
|
||||
// 用法:node scripts/acceptance/contact-sheet.mjs <截图目录> <输出目录> [前缀]
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import sharp from 'sharp';
|
||||
|
||||
const DIR = process.argv[2] || 'docs/acceptance/2026-10-21-full-qa/screenshots/public';
|
||||
const OUT = process.argv[3] || 'docs/acceptance/2026-10-21-full-qa/contact-sheets';
|
||||
const PREFIX = process.argv[4] || 'public';
|
||||
fs.mkdirSync(OUT, { recursive: true });
|
||||
|
||||
const COLS = 6;
|
||||
const CELL_W = 360;
|
||||
const GAP = 8;
|
||||
const LABEL_H = 26;
|
||||
|
||||
const escapeXml = (s) => s.replace(/[<>&'"]/g, (c) => ({ '<': '<', '>': '>', '&': '&', "'": ''', '"': '"' }[c]));
|
||||
|
||||
async function buildSheet(groupKey, files) {
|
||||
const tiles = [];
|
||||
for (const file of files.sort()) {
|
||||
const src = await sharp(path.join(DIR, file)).resize({ width: CELL_W, withoutEnlargement: true }).jpeg({ quality: 74 }).toBuffer();
|
||||
const meta = await sharp(src).metadata();
|
||||
const label = Buffer.from(
|
||||
`<svg width="${CELL_W}" height="${LABEL_H}" xmlns="http://www.w3.org/2000/svg">`
|
||||
+ `<rect width="${CELL_W}" height="${LABEL_H}" fill="#ffffff"/>`
|
||||
+ `<text x="4" y="17" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#111">${escapeXml(file.replace('__hero.jpg', ''))}</text>`
|
||||
+ '</svg>',
|
||||
);
|
||||
const tile = await sharp({ create: { width: CELL_W, height: meta.height + LABEL_H, channels: 3, background: '#ffffff' } })
|
||||
.composite([{ input: src, top: 0, left: 0 }, { input: label, top: meta.height, left: 0 }])
|
||||
.jpeg({ quality: 76 })
|
||||
.toBuffer();
|
||||
tiles.push(tile);
|
||||
}
|
||||
const rows = [];
|
||||
for (let i = 0; i < tiles.length; i += COLS) rows.push(tiles.slice(i, i + COLS));
|
||||
const rowHeights = [];
|
||||
for (const row of rows) {
|
||||
rowHeights.push(Math.max(...(await Promise.all(row.map(async (buf) => (await sharp(buf).metadata()).height)))));
|
||||
}
|
||||
const width = COLS * CELL_W + (COLS - 1) * GAP;
|
||||
const height = rowHeights.reduce((sum, h) => sum + h, 0) + (rows.length - 1) * GAP;
|
||||
const composites = [];
|
||||
let y = 0;
|
||||
for (let r = 0; r < rows.length; r += 1) {
|
||||
let x = 0;
|
||||
for (const tile of rows[r]) {
|
||||
composites.push({ input: tile, top: y, left: x });
|
||||
x += CELL_W + GAP;
|
||||
}
|
||||
y += rowHeights[r] + GAP;
|
||||
}
|
||||
const out = path.join(OUT, `${PREFIX}-${groupKey}.jpg`);
|
||||
await sharp({ create: { width, height, channels: 3, background: '#ffffff' } }).composite(composites).jpeg({ quality: 78 }).toFile(out);
|
||||
return { out, tiles: tiles.length, width, height };
|
||||
}
|
||||
|
||||
const files = fs.readdirSync(DIR).filter((f) => f.endsWith('__hero.jpg'));
|
||||
const groups = new Map();
|
||||
for (const file of files) {
|
||||
const m = file.match(/__(\d+)__([a-z]+)__([a-z]+)__hero\.jpg$/);
|
||||
if (!m) continue;
|
||||
const key = `${m[1]}-${m[2]}-${m[3]}`;
|
||||
if (!groups.has(key)) groups.set(key, []);
|
||||
groups.get(key).push(file);
|
||||
}
|
||||
const summary = [];
|
||||
for (const [key, groupFiles] of [...groups.entries()].sort()) {
|
||||
summary.push(await buildSheet(key, groupFiles));
|
||||
console.log(`sheet ${key}: ${summary[summary.length - 1].tiles} tiles -> ${summary[summary.length - 1].out}`);
|
||||
}
|
||||
fs.writeFileSync(path.join(OUT, `${PREFIX}-index.json`), JSON.stringify(summary, null, 2));
|
||||
@@ -0,0 +1,700 @@
|
||||
// 2026-10-21 全路由 UI/UE/UX 验收 sweep
|
||||
//
|
||||
// 用法:
|
||||
// BASE=http://127.0.0.1:3100 ROUTES=/tmp/qa-routes.xml OUT=docs/acceptance/2026-10-21-full-qa \
|
||||
// node scripts/acceptance/sweep-routes.mjs
|
||||
// MODE=admin ...(只跑后台) / MODE=both(先前台再后台)
|
||||
// ONLY=/about,/contact LIMIT=3 用于冒烟
|
||||
//
|
||||
// 判据不是「截图看着对」:每条运行都落不变量读数(祖先链 opacity 乘积、横向溢出、破图、
|
||||
// 同源失败请求、pageerror、文本裁切、触控目标、品牌红触达、圆角/字阶/动效时长),
|
||||
// 截图只作为定性评审与缺陷证据。
|
||||
import { chromium, firefox, webkit } from 'playwright';
|
||||
import sharp from 'sharp';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const BASE = (process.env.BASE || 'http://127.0.0.1:3100').replace(/\/$/, '');
|
||||
const OUT = process.env.OUT || 'docs/acceptance/2026-10-21-full-qa';
|
||||
const ROUTES_FILE = process.env.ROUTES;
|
||||
const ONLY = process.env.ONLY ? process.env.ONLY.split(',').map((s) => s.trim()).filter(Boolean) : null;
|
||||
const LIMIT = Number(process.env.LIMIT || 0);
|
||||
const MODE = process.env.MODE || 'public';
|
||||
const ADMIN_USER = process.env.ADMIN_USER || 'admin';
|
||||
const ADMIN_PASS = process.env.ADMIN_PASS || 'admin123';
|
||||
const EDITOR_USER = process.env.EDITOR_USER || 'e2e_editor';
|
||||
const EDITOR_PASS = process.env.EDITOR_PASS || 'editor123';
|
||||
|
||||
const SHOT_DIR = path.join(OUT, 'screenshots');
|
||||
const TMP_DIR = path.join(OUT, '.tmp');
|
||||
fs.mkdirSync(path.join(SHOT_DIR, 'public'), { recursive: true });
|
||||
fs.mkdirSync(path.join(SHOT_DIR, 'admin'), { recursive: true });
|
||||
fs.mkdirSync(TMP_DIR, { recursive: true });
|
||||
|
||||
const VIEWPORTS = {
|
||||
'1440': { width: 1440, height: 900, mobile: false },
|
||||
'834': { width: 834, height: 1194, mobile: false },
|
||||
'390': { width: 390, height: 844, mobile: true },
|
||||
};
|
||||
const MATRIX = [
|
||||
{ vp: '1440', theme: 'light' },
|
||||
{ vp: '1440', theme: 'dark' },
|
||||
{ vp: '834', theme: 'light' },
|
||||
{ vp: '390', theme: 'light' },
|
||||
{ vp: '390', theme: 'dark' },
|
||||
];
|
||||
const REPORT = {
|
||||
meta: { base: BASE, startedAt: new Date().toISOString(), routesFile: ROUTES_FILE || null, matrix: MATRIX },
|
||||
runs: [],
|
||||
adminRuns: [],
|
||||
notes: [],
|
||||
};
|
||||
|
||||
const slugOf = (p) => (p === '/' ? 'home' : p.replace(/^\//, '').replace(/[^a-zA-Z0-9._-]+/g, '_'));
|
||||
const isNoiseHost = (url) => {
|
||||
try {
|
||||
const host = new URL(url).hostname;
|
||||
return !['127.0.0.1', 'localhost'].includes(host) && !url.startsWith(BASE);
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
const flush = () => {
|
||||
REPORT.meta.finishedAt = new Date().toISOString();
|
||||
fs.writeFileSync(path.join(OUT, 'report.json'), JSON.stringify(REPORT, null, 2));
|
||||
};
|
||||
|
||||
async function loadRoutes() {
|
||||
let raw = '';
|
||||
if (ROUTES_FILE) raw = fs.readFileSync(ROUTES_FILE, 'utf8');
|
||||
else {
|
||||
const res = await fetch(`${BASE}/sitemap.xml`);
|
||||
raw = await res.text();
|
||||
}
|
||||
let routes;
|
||||
if (/<loc>/.test(raw)) {
|
||||
routes = [...raw.matchAll(/<loc>([^<]+)<\/loc>/g)].map((m) => {
|
||||
try { return new URL(m[1]).pathname; } catch { return null; }
|
||||
}).filter(Boolean);
|
||||
} else {
|
||||
routes = raw.split(/\r?\n/)
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => s && !s.startsWith('#'))
|
||||
.map((s) => (s.startsWith('http') ? new URL(s).pathname : s));
|
||||
}
|
||||
routes = [...new Set(routes)].filter((r) => !ONLY || ONLY.includes(r));
|
||||
if (LIMIT) routes = routes.slice(0, LIMIT);
|
||||
return routes;
|
||||
}
|
||||
|
||||
async function settle(page) {
|
||||
await page.waitForLoadState('load').catch(() => {});
|
||||
await page.waitForFunction(() => {
|
||||
const main = document.querySelector('main');
|
||||
if (!main) return true;
|
||||
let el = main;
|
||||
let product = 1;
|
||||
while (el) {
|
||||
product *= parseFloat(getComputedStyle(el).opacity || '1');
|
||||
el = el.parentElement;
|
||||
}
|
||||
return product > 0.99;
|
||||
}, { timeout: 10000 }).catch(() => {});
|
||||
await page.evaluate(() => document.querySelectorAll('img').forEach((img) => { img.loading = 'eager'; }));
|
||||
await page.evaluate(async () => {
|
||||
const step = Math.max(400, Math.floor(window.innerHeight * 0.8));
|
||||
for (let y = 0; y <= document.body.scrollHeight; y += step) {
|
||||
window.scrollTo(0, y);
|
||||
await new Promise((r) => setTimeout(r, 120));
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
await new Promise((r) => setTimeout(r, 250));
|
||||
});
|
||||
await page.waitForFunction(
|
||||
() => [...document.images].every((img) => img.complete),
|
||||
{ timeout: 15000 },
|
||||
).catch(() => {});
|
||||
await page.evaluate(() => document.fonts?.ready).catch(() => {});
|
||||
await page.waitForTimeout(500);
|
||||
}
|
||||
|
||||
async function measure(page) {
|
||||
return page.evaluate(() => {
|
||||
const visible = (el) => {
|
||||
if (!el) return false;
|
||||
const r = el.getBoundingClientRect();
|
||||
const s = getComputedStyle(el);
|
||||
return r.width > 0 && r.height > 0 && s.display !== 'none' && s.visibility !== 'hidden'
|
||||
&& parseFloat(s.opacity || '1') > 0.01;
|
||||
};
|
||||
let el = document.querySelector('main');
|
||||
let opacityProduct = 1;
|
||||
const opacityChain = [];
|
||||
while (el) {
|
||||
const o = parseFloat(getComputedStyle(el).opacity || '1');
|
||||
opacityProduct *= o;
|
||||
if (opacityChain.length < 8) opacityChain.push({ tag: el.tagName, opacity: o });
|
||||
el = el.parentElement;
|
||||
}
|
||||
const iw = window.innerWidth;
|
||||
const offenders = [];
|
||||
for (const node of document.querySelectorAll('body *')) {
|
||||
if (!visible(node)) continue;
|
||||
const r = node.getBoundingClientRect();
|
||||
if (r.right > iw + 1 || r.left < -1) {
|
||||
offenders.push({
|
||||
tag: node.tagName,
|
||||
cls: String(node.className || '').slice(0, 80),
|
||||
left: Math.round(r.left),
|
||||
right: Math.round(r.right),
|
||||
});
|
||||
if (offenders.length >= 8) break;
|
||||
}
|
||||
}
|
||||
const images = [...document.images]
|
||||
.filter((img) => img.currentSrc || img.src)
|
||||
.map((img) => ({ src: (img.currentSrc || img.src).split('/').pop(), complete: img.complete, nw: img.naturalWidth }));
|
||||
const broken = images.filter((img) => !img.complete || img.nw === 0);
|
||||
|
||||
const clipping = [];
|
||||
for (const node of document.querySelectorAll('h1,h2,h3,h4,p,span,a,li,dt,dd,label,button')) {
|
||||
if (!visible(node)) continue;
|
||||
const s = getComputedStyle(node);
|
||||
if (!/hidden|clip/.test(`${s.overflow}${s.overflowX}${s.overflowY}`)) continue;
|
||||
if (node.scrollHeight > node.clientHeight + 1 || node.scrollWidth > node.clientWidth + 1) {
|
||||
clipping.push({
|
||||
tag: node.tagName,
|
||||
text: (node.innerText || '').trim().slice(0, 60),
|
||||
sh: node.scrollHeight, ch: node.clientHeight, sw: node.scrollWidth, cw: node.clientWidth,
|
||||
});
|
||||
}
|
||||
if (clipping.length >= 8) break;
|
||||
}
|
||||
|
||||
const tinyText = [];
|
||||
for (const node of document.querySelectorAll('p,span,a,li,label,button,small,em')) {
|
||||
if (!visible(node)) continue;
|
||||
const fs = parseFloat(getComputedStyle(node).fontSize);
|
||||
if (fs < 10 && (node.innerText || '').trim()) {
|
||||
tinyText.push({ tag: node.tagName, fs: +fs.toFixed(1), text: (node.innerText || '').trim().slice(0, 40) });
|
||||
}
|
||||
if (tinyText.length >= 8) break;
|
||||
}
|
||||
|
||||
const touchTargets = [];
|
||||
for (const node of document.querySelectorAll('button,a,input,select,textarea,[role="button"]')) {
|
||||
if (!visible(node)) continue;
|
||||
const r = node.getBoundingClientRect();
|
||||
if (r.width < 44 || r.height < 44) {
|
||||
touchTargets.push({
|
||||
tag: node.tagName, w: Math.round(r.width), h: Math.round(r.height),
|
||||
text: (node.innerText || node.getAttribute('aria-label') || '').trim().slice(0, 40),
|
||||
});
|
||||
}
|
||||
if (touchTargets.length >= 12) break;
|
||||
}
|
||||
|
||||
const redTouches = [];
|
||||
for (const node of document.querySelectorAll('body *')) {
|
||||
if (!visible(node)) continue;
|
||||
const s = getComputedStyle(node);
|
||||
const hit = [s.color, s.backgroundColor, s.borderTopColor, s.borderLeftColor, s.borderRightColor, s.borderBottomColor]
|
||||
.some((v) => String(v || '').replace(/\s/g, '').includes('196,30,58'));
|
||||
if (hit) {
|
||||
redTouches.push({ tag: node.tagName, cls: String(node.className || '').slice(0, 70), text: (node.innerText || '').trim().slice(0, 30) });
|
||||
}
|
||||
if (redTouches.length >= 80) break;
|
||||
}
|
||||
|
||||
const radii = {};
|
||||
for (const node of document.querySelectorAll('button,a[role="button"],a[class*="bg-"]')) {
|
||||
if (!visible(node)) continue;
|
||||
const r = parseFloat(getComputedStyle(node).borderTopLeftRadius) || 0;
|
||||
radii[r] = (radii[r] || 0) + 1;
|
||||
}
|
||||
|
||||
// 大数字被容器挤到第二行(如「40%」+「+」、「99.2」+「%」)
|
||||
const wrappedNumbers = [];
|
||||
for (const node of document.querySelectorAll('.text-3xl,.text-4xl,.text-5xl,.text-6xl,[class*="tabular-nums"]')) {
|
||||
if (!visible(node)) continue;
|
||||
const text = (node.innerText || '').trim();
|
||||
if (!text || text.length > 24) continue;
|
||||
const s = getComputedStyle(node);
|
||||
const lh = parseFloat(s.lineHeight);
|
||||
const rect = node.getBoundingClientRect();
|
||||
if (lh && rect.height > lh * 1.6 && /^[\d.,%+×xX\-–—\s个月年月天周倍]+$/.test(text)) {
|
||||
wrappedNumbers.push({ text, w: Math.round(rect.width), h: Math.round(rect.height), lh: Math.round(lh), fs: s.fontSize });
|
||||
}
|
||||
if (wrappedNumbers.length >= 10) break;
|
||||
}
|
||||
|
||||
// 多列 grid 的某一行没排满(如 5 项塞进 4 列、3 项指标放进 4 列、2 张卡放进 5 列)。
|
||||
// 按每行 col-span 求和判断,避免把「12 栏非对称构图」这类有意的留白当成缺陷。
|
||||
const gridGaps = [];
|
||||
for (const grid of document.querySelectorAll('.grid')) {
|
||||
if (!visible(grid)) continue;
|
||||
const cs0 = getComputedStyle(grid);
|
||||
const cols = cs0.gridTemplateColumns.split(' ').filter(Boolean).length;
|
||||
// 只判「有底色」的网格:空列会变成一整块可见灰底;透明网格的留白多为有意构图。
|
||||
if (cols < 2 || cs0.backgroundColor === 'rgba(0, 0, 0, 0)') continue;
|
||||
const kids = [...grid.children].filter(visible);
|
||||
if (!kids.length) continue;
|
||||
const parseSpan = (value) => {
|
||||
const span = /^span\s+(\d+)/.exec(value || '');
|
||||
if (span) return Number(span[1]);
|
||||
if (/^\d+$/.test(value || '')) return Number(value);
|
||||
return null;
|
||||
};
|
||||
const rows = new Map();
|
||||
for (const kid of kids) {
|
||||
const cs = getComputedStyle(kid);
|
||||
const start = parseSpan(cs.gridColumnStart);
|
||||
const end = parseSpan(cs.gridColumnEnd);
|
||||
const explicit = /^\d+$/.test(cs.gridColumnStart) && /^\d+$/.test(cs.gridColumnEnd);
|
||||
const span = explicit && start && end ? Math.max(1, end - start) : Math.max(start || 1, end || 1);
|
||||
const top = Math.round(kid.getBoundingClientRect().top);
|
||||
if (!rows.has(top)) rows.set(top, { sum: 0, count: 0 });
|
||||
const row = rows.get(top);
|
||||
row.sum += span;
|
||||
row.count += 1;
|
||||
}
|
||||
const underfilled = [...rows.entries()]
|
||||
.filter(([, row]) => row.sum < cols)
|
||||
.map(([top, row]) => ({ top, sum: row.sum, count: row.count }));
|
||||
if (underfilled.length) {
|
||||
gridGaps.push({
|
||||
cls: String(grid.className || '').slice(0, 90),
|
||||
cols,
|
||||
kids: kids.length,
|
||||
bg: cs0.backgroundColor,
|
||||
underfilled,
|
||||
});
|
||||
}
|
||||
if (gridGaps.length >= 8) break;
|
||||
}
|
||||
|
||||
// col-span-* 挂在非 grid 父级的元素上 ⇒ 分栏意图失效(套件组合区的已知形状)
|
||||
const orphanColSpans = [];
|
||||
for (const node of document.querySelectorAll('[class*="col-span-"]')) {
|
||||
if (!visible(node)) continue;
|
||||
const parentDisplay = getComputedStyle(node.parentElement).display;
|
||||
if (parentDisplay !== 'grid' && parentDisplay !== 'inline-grid') {
|
||||
orphanColSpans.push({
|
||||
tag: node.tagName,
|
||||
cls: String(node.className || '').slice(0, 100),
|
||||
parentDisplay,
|
||||
text: (node.innerText || '').trim().slice(0, 40),
|
||||
});
|
||||
}
|
||||
if (orphanColSpans.length >= 8) break;
|
||||
}
|
||||
|
||||
const typography = {};
|
||||
for (const sel of ['h1', 'h2', 'h3', 'p']) {
|
||||
const node = document.querySelector(sel);
|
||||
if (!node) continue;
|
||||
const s = getComputedStyle(node);
|
||||
typography[sel] = {
|
||||
text: (node.innerText || '').trim().slice(0, 50),
|
||||
size: s.fontSize, weight: s.fontWeight, lineHeight: s.lineHeight,
|
||||
letterSpacing: s.letterSpacing, color: s.color,
|
||||
};
|
||||
}
|
||||
|
||||
let maxTransitionMs = 0;
|
||||
let maxAnimationMs = 0;
|
||||
for (const node of document.querySelectorAll('body *')) {
|
||||
const s = getComputedStyle(node);
|
||||
for (const v of s.transitionDuration.split(',')) {
|
||||
const n = parseFloat(v) || 0;
|
||||
maxTransitionMs = Math.max(maxTransitionMs, String(v).includes('ms') ? n : n * 1000);
|
||||
}
|
||||
for (const v of s.animationDuration.split(',')) {
|
||||
const n = parseFloat(v) || 0;
|
||||
maxAnimationMs = Math.max(maxAnimationMs, String(v).includes('ms') ? n : n * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
const hero = document.querySelector('[data-testid*="hero"], main section');
|
||||
const h1 = document.querySelector('h1');
|
||||
const tabBar = document.querySelector('[data-testid="mobile-tab-bar"]');
|
||||
const cta = [...document.querySelectorAll('a,button')]
|
||||
.find((node) => visible(node) && (node.innerText || '').includes('预约咨询'));
|
||||
const form = document.querySelector('form');
|
||||
return {
|
||||
path: location.pathname,
|
||||
title: document.title,
|
||||
opacityProduct: +opacityProduct.toFixed(3),
|
||||
opacityChain,
|
||||
innerWidth: iw,
|
||||
scrollWidth: document.documentElement.scrollWidth,
|
||||
overflowX: document.documentElement.scrollWidth > iw + 1,
|
||||
offenders,
|
||||
images: images.length,
|
||||
broken,
|
||||
clippingCount: clipping.length,
|
||||
clipping,
|
||||
tinyTextCount: tinyText.length,
|
||||
tinyText,
|
||||
touchTargetCount: touchTargets.length,
|
||||
touchTargets,
|
||||
redTouches: redTouches.length,
|
||||
redSample: redTouches.slice(0, 15),
|
||||
radii,
|
||||
wrappedNumbers,
|
||||
orphanColSpans,
|
||||
gridGaps,
|
||||
typography,
|
||||
maxTransitionMs: Math.round(maxTransitionMs),
|
||||
maxAnimationMs: Math.round(maxAnimationMs),
|
||||
heroHeight: hero ? Math.round(hero.getBoundingClientRect().height) : null,
|
||||
primaryCta: cta ? {
|
||||
top: Math.round(cta.getBoundingClientRect().top + window.scrollY),
|
||||
inFirstViewport: cta.getBoundingClientRect().top < window.innerHeight,
|
||||
} : null,
|
||||
form: form ? {
|
||||
top: Math.round(form.getBoundingClientRect().top + window.scrollY),
|
||||
inFirstViewport: form.getBoundingClientRect().top < window.innerHeight,
|
||||
fields: form.querySelectorAll('input,textarea,select').length,
|
||||
} : null,
|
||||
h1Text: h1 ? (h1.innerText || '').trim().slice(0, 120) : null,
|
||||
h1Count: document.querySelectorAll('h1').length,
|
||||
docHeight: document.documentElement.scrollHeight,
|
||||
mobileTabBar: tabBar ? visible(tabBar) : false,
|
||||
bodyTextLength: (document.body.innerText || '').trim().length,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function redPixelRatio(pngPath) {
|
||||
const { data, info } = await sharp(pngPath).resize({ width: 300 }).raw().toBuffer({ resolveWithObject: true });
|
||||
let red = 0;
|
||||
const total = info.width * info.height;
|
||||
for (let i = 0; i < data.length; i += info.channels) {
|
||||
if (Math.abs(data[i] - 196) <= 28 && Math.abs(data[i + 1] - 30) <= 28 && Math.abs(data[i + 2] - 58) <= 28) red += 1;
|
||||
}
|
||||
return +(red / total).toFixed(4);
|
||||
}
|
||||
|
||||
async function saveShots(page, dir, baseName, viewport) {
|
||||
await page.screenshot({
|
||||
path: path.join(dir, `${baseName}__hero.jpg`), type: 'jpeg', quality: 80,
|
||||
animations: 'disabled', caret: 'hide', timeout: 30000,
|
||||
});
|
||||
const tmp = path.join(TMP_DIR, `${baseName}.png`);
|
||||
await page.screenshot({
|
||||
path: tmp, fullPage: true, animations: 'disabled', caret: 'hide', timeout: 60000,
|
||||
});
|
||||
const meta = await sharp(tmp).metadata();
|
||||
const files = [];
|
||||
if (meta.height > 15000) {
|
||||
for (let y = 0, i = 1; y < meta.height; y += 8000, i += 1) {
|
||||
const height = Math.min(8000, meta.height - y);
|
||||
const file = path.join(dir, `${baseName}__full-p${i}.webp`);
|
||||
await sharp(tmp).extract({ left: 0, top: y, width: meta.width, height }).webp({ quality: 78 }).toFile(file);
|
||||
files.push(path.basename(file));
|
||||
}
|
||||
} else {
|
||||
const file = path.join(dir, `${baseName}__full.webp`);
|
||||
await sharp(tmp).webp({ quality: 78 }).toFile(file);
|
||||
files.push(path.basename(file));
|
||||
}
|
||||
const ratio = await redPixelRatio(tmp);
|
||||
fs.unlinkSync(tmp);
|
||||
return { files, redPixelRatio: ratio, width: meta.width, height: meta.height };
|
||||
}
|
||||
|
||||
async function runOne(browser, engine, route, vpName, theme) {
|
||||
const vp = VIEWPORTS[vpName];
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: vp.width, height: vp.height },
|
||||
colorScheme: theme === 'dark' ? 'dark' : 'light',
|
||||
reducedMotion: 'reduce',
|
||||
...(vp.mobile && engine === 'chromium' ? { isMobile: true, hasTouch: true, deviceScaleFactor: 2 } : {}),
|
||||
});
|
||||
const page = await context.newPage();
|
||||
await page.addInitScript(() => {
|
||||
localStorage.setItem('novalon-cookie-preferences', JSON.stringify({
|
||||
necessary: true, analytics: false, marketing: false, functionality: true, timestamp: 1784284000000,
|
||||
}));
|
||||
});
|
||||
const consoleErrors = [];
|
||||
const pageErrors = [];
|
||||
const failedRequests = [];
|
||||
const thirdParty = [];
|
||||
page.on('console', (m) => { if (m.type() === 'error') consoleErrors.push(m.text().slice(0, 240)); });
|
||||
page.on('pageerror', (e) => pageErrors.push(String(e).slice(0, 240)));
|
||||
page.on('requestfailed', (req) => {
|
||||
const item = { url: req.url().slice(0, 180), error: req.failure()?.errorText };
|
||||
(isNoiseHost(req.url()) ? thirdParty : failedRequests).push(item);
|
||||
});
|
||||
page.on('response', (res) => {
|
||||
if (res.status() >= 400) {
|
||||
const item = { url: res.url().slice(0, 180), status: res.status() };
|
||||
(isNoiseHost(res.url()) ? thirdParty : failedRequests).push(item);
|
||||
}
|
||||
});
|
||||
const started = Date.now();
|
||||
let metrics = null;
|
||||
let shots = null;
|
||||
let error = null;
|
||||
try {
|
||||
await page.goto(BASE + route, { waitUntil: 'domcontentloaded', timeout: 45000 });
|
||||
await settle(page);
|
||||
if (theme === 'dark') {
|
||||
await page.evaluate(() => document.documentElement.setAttribute('data-theme', 'dark'));
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
metrics = await measure(page);
|
||||
await page.evaluate(() => window.scrollTo(0, 0));
|
||||
await page.waitForTimeout(200);
|
||||
const baseName = `${slugOf(route)}__${vpName}__${theme}__${engine}`;
|
||||
shots = await saveShots(page, path.join(SHOT_DIR, 'public'), baseName, vp);
|
||||
} catch (err) {
|
||||
error = String(err).slice(0, 300);
|
||||
}
|
||||
await context.close();
|
||||
// `/_not-found` 是 404 哨兵页:文档自身 404 是契约,不是失败;其余 4xx/5xx 仍判红。
|
||||
const expected404 = route === '/_not-found';
|
||||
const httpErrors = failedRequests.filter((r) => r.status >= 400);
|
||||
const unexpectedHttp = expected404
|
||||
? httpErrors.filter((r) => {
|
||||
try { return new URL(r.url).pathname !== '/_not-found'; } catch { return true; }
|
||||
})
|
||||
: httpErrors;
|
||||
const hard = Boolean(error) || !metrics
|
||||
|| metrics.opacityProduct < 0.99
|
||||
|| metrics.overflowX
|
||||
|| metrics.broken.length > 0
|
||||
|| pageErrors.length > 0
|
||||
|| unexpectedHttp.length > 0;
|
||||
return {
|
||||
kind: 'public', engine, route, viewport: vpName, theme,
|
||||
durationMs: Date.now() - started,
|
||||
...(metrics || {}),
|
||||
shots,
|
||||
consoleErrors,
|
||||
pageErrors,
|
||||
failedRequests,
|
||||
thirdParty,
|
||||
expected404,
|
||||
hardFailure: hard,
|
||||
error,
|
||||
};
|
||||
}
|
||||
|
||||
async function loginAndState(browser, viewport, username, password, colorScheme) {
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: viewport.width, height: viewport.height },
|
||||
colorScheme, reducedMotion: 'reduce',
|
||||
...(viewport.mobile ? { isMobile: true, hasTouch: true, deviceScaleFactor: 2 } : {}),
|
||||
});
|
||||
const page = await context.newPage();
|
||||
await page.goto(`${BASE}/admin/login`, { waitUntil: 'networkidle', timeout: 45000 }).catch(() => {});
|
||||
// 表单是客户端组件:水合前点击不会触发 React handler(native submit 停在原页)。
|
||||
await page.waitForTimeout(1200);
|
||||
await page.fill('#admin-login-username', username);
|
||||
await page.fill('#admin-login-password', password);
|
||||
await page.click('button[type="submit"]');
|
||||
await page.waitForURL((url) => !url.pathname.includes('/admin/login'), { timeout: 20000 }).catch(() => {});
|
||||
await page.waitForTimeout(1500);
|
||||
const loggedIn = !page.url().includes('/admin/login');
|
||||
const state = loggedIn ? await context.storageState() : null;
|
||||
return { context, page, loggedIn, state };
|
||||
}
|
||||
|
||||
async function captureAdminPage(browser, state, route, vpName, theme, dir) {
|
||||
const vp = VIEWPORTS[vpName];
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: vp.width, height: vp.height },
|
||||
storageState: state,
|
||||
colorScheme: theme === 'dark' ? 'dark' : 'light',
|
||||
reducedMotion: 'reduce',
|
||||
...(vp.mobile ? { isMobile: true, hasTouch: true, deviceScaleFactor: 2 } : {}),
|
||||
});
|
||||
const page = await context.newPage();
|
||||
const consoleErrors = [];
|
||||
const pageErrors = [];
|
||||
const failedRequests = [];
|
||||
page.on('console', (m) => { if (m.type() === 'error') consoleErrors.push(m.text().slice(0, 240)); });
|
||||
page.on('pageerror', (e) => pageErrors.push(String(e).slice(0, 240)));
|
||||
page.on('response', (res) => {
|
||||
if (res.status() >= 400 && !isNoiseHost(res.url())) failedRequests.push({ url: res.url().slice(0, 180), status: res.status() });
|
||||
});
|
||||
let metrics = null;
|
||||
let shots = null;
|
||||
let error = null;
|
||||
try {
|
||||
await page.goto(BASE + route, { waitUntil: 'networkidle', timeout: 45000 }).catch(() => {});
|
||||
await page.waitForTimeout(1500);
|
||||
if (theme === 'dark') {
|
||||
await page.evaluate(() => document.documentElement.setAttribute('data-theme', 'dark'));
|
||||
await page.waitForTimeout(400);
|
||||
}
|
||||
metrics = await measure(page);
|
||||
const baseName = `admin-${slugOf(route.replace('/admin', '')) || 'root'}__${vpName}__${theme}__chromium`;
|
||||
shots = await saveShots(page, dir, baseName, vp);
|
||||
} catch (err) {
|
||||
error = String(err).slice(0, 300);
|
||||
}
|
||||
const url = page.url();
|
||||
await context.close();
|
||||
return {
|
||||
kind: 'admin', route, url, viewport: vpName, theme,
|
||||
...(metrics || {}), shots, consoleErrors, pageErrors, failedRequests,
|
||||
hardFailure: Boolean(error) || failedRequests.filter((r) => r.status >= 500).length > 0,
|
||||
error,
|
||||
};
|
||||
}
|
||||
|
||||
async function runAdmin(browser) {
|
||||
const dir = path.join(SHOT_DIR, 'admin');
|
||||
const desktop = VIEWPORTS['1440'];
|
||||
|
||||
// 登录页自身也要进视觉验收(未登录上下文)
|
||||
for (const combo of MATRIX) {
|
||||
const run = await captureAdminPage(browser, undefined, '/admin/login', combo.vp, combo.theme, dir);
|
||||
REPORT.adminRuns.push(run);
|
||||
flush();
|
||||
console.log(`[admin] /admin/login ${combo.vp}/${combo.theme} hard=${run.hardFailure} ${run.durationMs || ''}ms`);
|
||||
}
|
||||
|
||||
const login = await loginAndState(browser, desktop, ADMIN_USER, ADMIN_PASS, 'light');
|
||||
const loginUrl = login.page.url();
|
||||
const loginBody = (await login.page.locator('body').innerText().catch(() => '')).slice(0, 500);
|
||||
await login.context.close();
|
||||
REPORT.notes.push({ adminLogin: { loggedIn: login.loggedIn, url: loginUrl, bodySnippet: loginBody } });
|
||||
if (!login.loggedIn || !login.state) {
|
||||
REPORT.notes.push({ adminSweep: 'skipped: admin login failed' });
|
||||
return;
|
||||
}
|
||||
|
||||
// 登录失败态(错误密码)
|
||||
const bad = await browser.newContext({ viewport: desktop, reducedMotion: 'reduce' });
|
||||
const badPage = await bad.newPage();
|
||||
await badPage.goto(`${BASE}/admin/login`, { waitUntil: 'networkidle' });
|
||||
await badPage.waitForTimeout(1200);
|
||||
await badPage.fill('#admin-login-username', ADMIN_USER);
|
||||
await badPage.fill('#admin-login-password', 'definitely-wrong-password');
|
||||
await badPage.click('button[type="submit"]');
|
||||
await badPage.waitForTimeout(2500);
|
||||
await badPage.screenshot({ path: path.join(dir, 'admin-login-error__1440__light__chromium__full.webp'), fullPage: true }).catch(() => {});
|
||||
REPORT.notes.push({ adminLoginErrorText: (await badPage.locator('body').innerText().catch(() => '')).slice(0, 300) });
|
||||
await bad.close();
|
||||
|
||||
// 取得的条目 id(用于编辑器页面);取不到就用 new
|
||||
const probeContext = await browser.newContext({ viewport: desktop, storageState: login.state, reducedMotion: 'reduce' });
|
||||
const probe = await probeContext.newPage();
|
||||
await probe.goto(`${BASE}/admin/content/news`, { waitUntil: 'networkidle' }).catch(() => {});
|
||||
await probe.waitForTimeout(1200);
|
||||
const itemHref = await probe.evaluate(() => {
|
||||
const link = [...document.querySelectorAll('a[href*="/admin/content/news/"]')]
|
||||
.find((a) => !a.getAttribute('href').endsWith('/new'));
|
||||
return link ? link.getAttribute('href') : null;
|
||||
});
|
||||
await probeContext.close();
|
||||
REPORT.notes.push({ adminNewsItemHref: itemHref });
|
||||
|
||||
const adminPages = [
|
||||
'/admin',
|
||||
'/admin/content/news',
|
||||
itemHref || '/admin/content/news/new',
|
||||
'/admin/media',
|
||||
'/admin/notifications',
|
||||
'/admin/roles',
|
||||
'/admin/users',
|
||||
'/admin/zones',
|
||||
];
|
||||
if (ONLY) {
|
||||
const filtered = adminPages.filter((p) => ONLY.some((o) => p.includes(o)));
|
||||
adminPages.length = 0;
|
||||
adminPages.push(...filtered);
|
||||
}
|
||||
for (const route of adminPages) {
|
||||
for (const combo of MATRIX) {
|
||||
const run = await captureAdminPage(browser, login.state, route, combo.vp, combo.theme, dir);
|
||||
REPORT.adminRuns.push(run);
|
||||
flush();
|
||||
console.log(`[admin] ${route} ${combo.vp}/${combo.theme} hard=${run.hardFailure} ${run.durationMs || ''}ms`);
|
||||
}
|
||||
}
|
||||
|
||||
// 删除确认弹窗(打开后取消,不写库)
|
||||
const dialogContext = await browser.newContext({ viewport: desktop, storageState: login.state, reducedMotion: 'reduce' });
|
||||
const dialogPage = await dialogContext.newPage();
|
||||
await dialogPage.goto(`${BASE}/admin/content/news`, { waitUntil: 'networkidle' }).catch(() => {});
|
||||
await dialogPage.waitForTimeout(1200);
|
||||
const deleteButton = dialogPage.locator('button[title="删除"]').first();
|
||||
const hasDelete = await deleteButton.count();
|
||||
if (hasDelete) {
|
||||
await deleteButton.click().catch(() => {});
|
||||
await dialogPage.waitForTimeout(800);
|
||||
await dialogPage.screenshot({ path: path.join(dir, 'admin-delete-dialog__1440__light__chromium__full.webp'), fullPage: true }).catch(() => {});
|
||||
const cancel = dialogPage.getByRole('button', { name: /取消/ }).first();
|
||||
await cancel.click().catch(() => {});
|
||||
REPORT.notes.push({ adminDeleteDialog: 'opened and cancelled' });
|
||||
} else {
|
||||
REPORT.notes.push({ adminDeleteDialog: 'delete button not found on /admin/content/news' });
|
||||
}
|
||||
await dialogContext.close();
|
||||
|
||||
// 权限拒绝态(content_editor 直访 /admin/users)
|
||||
const editor = await loginAndState(browser, desktop, EDITOR_USER, EDITOR_PASS, 'light');
|
||||
if (editor.loggedIn && editor.state) {
|
||||
const ctx = await browser.newContext({ viewport: desktop, storageState: editor.state, reducedMotion: 'reduce' });
|
||||
const page = await ctx.newPage();
|
||||
await page.goto(`${BASE}/admin/users`, { waitUntil: 'networkidle' }).catch(() => {});
|
||||
await page.waitForTimeout(1500);
|
||||
await page.screenshot({ path: path.join(dir, 'admin-permission-denied__1440__light__chromium__full.webp'), fullPage: true }).catch(() => {});
|
||||
REPORT.notes.push({ adminPermissionDenied: { url: page.url(), body: (await page.locator('body').innerText().catch(() => '')).slice(0, 300) } });
|
||||
await ctx.close();
|
||||
} else {
|
||||
REPORT.notes.push({ adminPermissionDenied: 'skipped: editor login failed' });
|
||||
}
|
||||
await editor.context.close();
|
||||
}
|
||||
|
||||
const routes = await loadRoutes();
|
||||
REPORT.meta.routes = routes;
|
||||
REPORT.meta.routeCount = routes.length;
|
||||
flush();
|
||||
console.log(`routes=${routes.length} mode=${MODE}`);
|
||||
|
||||
const browsers = { chromium: await chromium.launch(), firefox: await firefox.launch(), webkit: await webkit.launch() };
|
||||
try {
|
||||
if (MODE === 'public' || MODE === 'both') {
|
||||
for (const route of routes) {
|
||||
for (const combo of MATRIX) {
|
||||
const run = await runOne(browsers.chromium, 'chromium', route, combo.vp, combo.theme);
|
||||
REPORT.runs.push(run);
|
||||
flush();
|
||||
console.log(`[public] ${route} ${combo.vp}/${combo.theme} hard=${run.hardFailure} ${run.durationMs}ms`);
|
||||
}
|
||||
}
|
||||
const detail = routes.find((r) => r.split('/').filter(Boolean).length >= 2 && !['/about/brand', '/products/erp-upgrade', '/products/erp-upgrade-v3', '/news/company-founded'].includes(r));
|
||||
const crossRoutes = ['/', '/about', '/contact', '/products', ...(detail ? [detail] : [])];
|
||||
for (const engine of ['firefox', 'webkit']) {
|
||||
for (const route of crossRoutes) {
|
||||
for (const combo of [{ vp: '1440', theme: 'light' }, { vp: '390', theme: 'light' }]) {
|
||||
const run = await runOne(browsers[engine], engine, route, combo.vp, combo.theme);
|
||||
REPORT.runs.push(run);
|
||||
flush();
|
||||
console.log(`[public:${engine}] ${route} ${combo.vp}/${combo.theme} hard=${run.hardFailure} ${run.durationMs}ms`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (MODE === 'admin' || MODE === 'both') {
|
||||
await runAdmin(browsers.chromium);
|
||||
flush();
|
||||
}
|
||||
} finally {
|
||||
await browsers.chromium.close();
|
||||
await browsers.firefox.close();
|
||||
await browsers.webkit.close();
|
||||
flush();
|
||||
}
|
||||
|
||||
const hard = REPORT.runs.filter((r) => r.hardFailure).length + REPORT.adminRuns.filter((r) => r.hardFailure).length;
|
||||
console.log(`DONE runs=${REPORT.runs.length} adminRuns=${REPORT.adminRuns.length} hardFailures=${hard} -> ${path.join(OUT, 'report.json')}`);
|
||||
process.exit(hard > 0 ? 1 : 0);
|
||||
Reference in new issue
Block a user