dark-mode-toggle
靶子: http://localhost:20098 (推导自 /data/AICode/e2e/ma_dev_v2/ma/docker-compose-tp8/.env)
[A] 暗色模式开关功能
PASS A1 初始为亮色(无 data-theme) — 期望 null 实得 null
PASS A2 初始图标为月亮 ☾ — 期望 "☾" 实得 "☾"
PASS A3 点击后 <html data-theme> = dark — 期望 "dark" 实得 "dark"
PASS A4 点击后 body 背景变为暗色 — 期望 "rgb(10, 10, 10)" 实得 "rgb(10, 10, 10)"
PASS A5 点击后图标翻为太阳 ☀ — 期望 "☀" 实得 "☀"
PASS A6 点击后 aria-label 翻转 — 期望 "Switch to light mode" 实得 "Switch to light mode"
PASS A7 再点一次切回亮色(data-theme 清除) — 期望 null 实得 null
PASS A8 再点一次背景回到初始亮色 — 期望 "rgb(255, 255, 255)" 实得 "rgb(255, 255, 255)"
PASS A9 图标翻回月亮 ☾ — 期望 "☾" 实得 "☾"
[B] URL 参数入口
PASS B1 ?_dark=1 当次加载即进入暗色 — 期望 "dark" 实得 "dark"
PASS B2 ?_dark=0 退出暗色 — 期望 null 实得 null
[C] 按钮几何(间距与对齐)
PASS C-desktop 两按钮均可见
desktop: 月亮={"x":1366,"y":760,"w":44,"h":44,"bottom":804,"cx":1388} 客服={"x":1360,"y":820,"w":56,"h":56,"bottom":876,"cx":1388}
PASS C-desktop 垂直间距 — 期望 16 实得 16
PASS C-desktop 中心线水平偏移 — 期望 0 实得 0
PASS C-desktop 月亮按钮中心可点(未被遮挡) — 期望 "darkModeToggle" 实得 "darkModeToggle"
PASS C-mobile 两按钮均可见
mobile: 月亮={"x":324,"y":712,"w":44,"h":44,"bottom":756,"cx":346} 客服={"x":318,"y":772,"w":56,"h":56,"bottom":828,"cx":346}
PASS C-mobile 垂直间距 — 期望 16 实得 16
PASS C-mobile 中心线水平偏移 — 期望 0 实得 0
PASS C-mobile 月亮按钮中心可点(未被遮挡) — 期望 "darkModeToggle" 实得 "darkModeToggle"
截图目录: /data/AICode/e2e/ma_dev_v2/ma/bin/workspace/test-results/playwright-images/dark-mode-fab-fix
结果: PASS=19 FAIL=0