test: verify forest AI MVP unification
This commit is contained in:
@@ -519,7 +519,7 @@ if (desktopLoginMetrics.title !== '森林AI') failures.push(`unexpected title ${
|
|||||||
if (desktopColumnCount !== 2) failures.push(`desktop login must use two columns, got ${desktopLoginMetrics.columns}`)
|
if (desktopColumnCount !== 2) failures.push(`desktop login must use two columns, got ${desktopLoginMetrics.columns}`)
|
||||||
|
|
||||||
await page.setViewportSize({ width: 390, height: 844 })
|
await page.setViewportSize({ width: 390, height: 844 })
|
||||||
await page.screenshot({ path: 'test-results/login-react-acro-mobile.png', fullPage: true })
|
await page.screenshot({ path: 'test-results/login-react-acro-mobile.png' })
|
||||||
const mobileLoginMetrics = await collectLoginMetrics()
|
const mobileLoginMetrics = await collectLoginMetrics()
|
||||||
const mobileColumnCount = getColumnCount(mobileLoginMetrics.columns)
|
const mobileColumnCount = getColumnCount(mobileLoginMetrics.columns)
|
||||||
if (mobileLoginMetrics.overflowX) failures.push('mobile login must not overflow horizontally')
|
if (mobileLoginMetrics.overflowX) failures.push('mobile login must not overflow horizontally')
|
||||||
@@ -566,7 +566,10 @@ await page.screenshot({ path: 'test-results/project-react-acro-light.png', fullP
|
|||||||
const projectMetrics = await collectMetrics()
|
const projectMetrics = await collectMetrics()
|
||||||
|
|
||||||
await page.setViewportSize({ width: 390, height: 844 })
|
await page.setViewportSize({ width: 390, height: 844 })
|
||||||
|
await page.waitForFunction(() => [...document.querySelectorAll('.project-rail, .channel-sidebar')]
|
||||||
|
.every((node) => getComputedStyle(node).visibility === 'hidden'))
|
||||||
const mobileProjectMetrics = await collectMetrics()
|
const mobileProjectMetrics = await collectMetrics()
|
||||||
|
await page.screenshot({ path: 'test-results/project-react-acro-mobile.png', fullPage: true })
|
||||||
const projectNavButton = page.getByRole('button', { name: '打开项目导航', exact: true })
|
const projectNavButton = page.getByRole('button', { name: '打开项目导航', exact: true })
|
||||||
if (await projectNavButton.count() === 0) {
|
if (await projectNavButton.count() === 0) {
|
||||||
failures.push('missing mobile button 打开项目导航')
|
failures.push('missing mobile button 打开项目导航')
|
||||||
@@ -1003,6 +1006,9 @@ for (const channel of [
|
|||||||
]) {
|
]) {
|
||||||
await page.locator('.channel-button', { hasText: channel.label }).click()
|
await page.locator('.channel-button', { hasText: channel.label }).click()
|
||||||
await page.waitForTimeout(250)
|
await page.waitForTimeout(250)
|
||||||
|
if (channel.label === '工作计划') {
|
||||||
|
await page.screenshot({ path: 'test-results/project-tasks.png', fullPage: true })
|
||||||
|
}
|
||||||
if (channel.label === 'AI 助手') {
|
if (channel.label === 'AI 助手') {
|
||||||
const aiPage = page.locator('.project-ai-page')
|
const aiPage = page.locator('.project-ai-page')
|
||||||
await aiPage.getByText('项目风险梳理', { exact: true }).waitFor({ state: 'visible', timeout: 2000 })
|
await aiPage.getByText('项目风险梳理', { exact: true }).waitFor({ state: 'visible', timeout: 2000 })
|
||||||
|
|||||||
66
docs/forest-ai-audit.md
Normal file
66
docs/forest-ai-audit.md
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# 森林AI MVP 最终验证与视觉审计
|
||||||
|
|
||||||
|
审计日期:2026-07-21
|
||||||
|
|
||||||
|
## 结论
|
||||||
|
|
||||||
|
本轮对统一版 MVP 做了后端、Web、桌面壳和响应式页面的全量验证。自动化命令均以 0 退出;最终截图逐张打开检查,未发现裁切、错误页、加载中画面或横向溢出。PostgreSQL 实时连接因本机未配置 `DATABASE_URL` 而跳过,不能据此宣称数据库集成环境已验收。
|
||||||
|
|
||||||
|
截图是本地审计产物,保存在 `apps/web_v1/test-results/`,由 Git 忽略,不随本文档提交。
|
||||||
|
|
||||||
|
## 证据视口与页面
|
||||||
|
|
||||||
|
| 视口 | 本地截图 | 检查结果 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| 1440×1024 | `login-react-acro.png` | 两栏登录卡完整,服务器地址、连接状态、账号、密码和登录动作清楚可见 |
|
||||||
|
| 1440×1024 | `workbench-react-acro-light.png` | 项目轨道与主内容对齐,无常驻项目频道侧栏或右侧检查器 |
|
||||||
|
| 1440×1024 | `project-react-acro-light.png` | 96px 项目轨道、248px 频道侧栏和主内容连续铺满视口 |
|
||||||
|
| 1440×1024 | `project-tasks.png` | 真实标签、空状态与创建入口可见,不再显示固定进度 |
|
||||||
|
| 1440×1024 | `project-ai-controlled.png` | 会话列表、受控创建入口和“不会自动生成正式对象”说明可见 |
|
||||||
|
| 1440×1024 | `project-inbox-confirmed.png` | 收集内容、分析建议、选择项、确认结果和不可重复写入状态可见 |
|
||||||
|
| 390×844 | `login-react-acro-mobile.png` | 单栏布局,无水平裁切;首屏下方内容可纵向滚动 |
|
||||||
|
| 390×844 | `project-react-acro-mobile.png` | 默认关闭导航后主内容可访问,无横向溢出 |
|
||||||
|
| 390×844 | `project-navigation-mobile.png` | 项目抽屉、遮罩与关闭路径可见 |
|
||||||
|
| 390×844 | `channel-navigation-mobile.png` | 频道抽屉、最近会话与关闭路径可见 |
|
||||||
|
| 390×844 | `project-inbox-confirmed-mobile.png` | Inbox 列表和详情按单列重排,无横向溢出 |
|
||||||
|
|
||||||
|
视觉脚本在桌面切换到移动视口后,会等待项目轨道与频道侧栏真正进入隐藏状态再采集项目主内容,避免把 160ms 收起动画的中间帧误当成最终证据。
|
||||||
|
|
||||||
|
## 与初始审计的对比
|
||||||
|
|
||||||
|
对照 `apps/web_v1/test-results/audit-current/01-login.png` 至 `05-tasks.png`:
|
||||||
|
|
||||||
|
- 登录页由会裁切右栏的三栏卡片改为完整双栏;`森林Agent`、`SenlinAI`、`AI Agent` 已统一为“森林AI / AI 助手”,字母占位图形替换为正式图标。
|
||||||
|
- 工作台与项目页移除了升级、支付、固定存储空间、`AI 空闲`、`实时接口` 和固定 `进度 60%` 等无真实依据的状态。
|
||||||
|
- 项目页取消常驻右侧检查器,布局边界变为项目轨道、频道侧栏和主内容三段连续结构;项目强调色集中在横幅和小型标记。
|
||||||
|
- 任务页从静态示例卡片改为后端工作区数据驱动的标签、计数和空状态。
|
||||||
|
- 390px 项目页不再是桌面布局左侧切片;主内容默认可见,项目与频道分别通过顶部按钮打开抽屉。
|
||||||
|
- Inbox 和 AI 页面明确保留“分析/受控会话 → 用户确认 → 正式对象”的边界,不把 AI 输出表现为已经自动执行。
|
||||||
|
|
||||||
|
## 核心交互与安全边界
|
||||||
|
|
||||||
|
本轮视觉回归不仅截图,还覆盖下列交互状态:
|
||||||
|
|
||||||
|
- 登录连接检查、提交和工作台落地。
|
||||||
|
- 项目/任务/笔记关键词搜索;较慢的旧响应不能覆盖较新的结果。
|
||||||
|
- 被授权的外部任务或笔记只打开受限预览,不加载或切换到无所有权的项目工作区;未知结果类型不伪造项目导航。
|
||||||
|
- 项目设置更新包含写入中状态、成功刷新和中文失败提示。
|
||||||
|
- Inbox 分析只读取服务端保存的建议;确认只发送勾选的建议 identity。网络结果不确定时冻结选择并复用原请求安全重试,确定性 400、409 冲突和写入后刷新失败分别处理。
|
||||||
|
- AI 会话创建只发送标题和项目上下文;同项目乱序 GET、跨项目延迟 POST 和项目切换后的加载失败不会污染当前项目状态。
|
||||||
|
- 探索数据源、自定义频道/外链、升级支付、窗口停靠和自主 Agent 等范围外能力不呈现为可成功执行的控件。
|
||||||
|
|
||||||
|
后端全量测试和静态检查通过,但本审计不以截图推断完整的认证、数据库或 WCAG 合规。真实 bearer token 生命周期、PostgreSQL 行为、完整键盘顺序、焦点可见性、对比度和屏幕阅读器名称仍应分别在集成环境和人工辅助技术检查中复核。
|
||||||
|
|
||||||
|
## 剩余限制
|
||||||
|
|
||||||
|
- 当前环境没有 `DATABASE_URL`,且 PostgreSQL 测试带 `integration` build tag;指定的非 tag 命令只报告 `no tests to run`。需要在隔离测试库中显式运行带 tag 的集成测试。
|
||||||
|
- 当前环境未安装 Docker CLI,未执行 Compose 启动、数据库初始化或容器内端到端检查。
|
||||||
|
- Web 构建成功,但主 JavaScript chunk 约 663 kB、主 CSS chunk 约 591 kB,Vite 报告大于 500 kB 的体积警告;这是性能优化项,不阻塞 MVP 正确性验收。
|
||||||
|
- 桌面壳构建成功;Windows 链接器输出了导入库创建信息并被 Rust 记录为一条 linker warning,没有构建错误。
|
||||||
|
- 390px 项目概览的四个指标仍保持单行四列,中文标签换行较密;内容可读且未溢出,但后续可改为两列以提升扫读效率。
|
||||||
|
- 390×844 登录首屏为了保留品牌说明,登录按钮位于首屏下方,需要纵向滚动;页面无水平裁切,仍可完成登录。
|
||||||
|
- 截图只能证明采集状态下的视觉结果,不能替代真实网络、慢设备、缩放、键盘和辅助技术测试。
|
||||||
|
|
||||||
|
## 仓库卫生
|
||||||
|
|
||||||
|
提交前检查确认没有被 Git 跟踪的 `dist`、`target`、`test-results`、日志、数据库、私钥、证书或真实 `.env` 文件。截图、Web 构建目录、Tauri 构建目录和 `.superpowers/` 报告均由忽略规则覆盖;控制器已有的 `.superpowers/sdd/progress.md` 修改未纳入本提交。
|
||||||
Reference in New Issue
Block a user