test(e2e): align UI P0 coverage with the current product (#6405)

* test(e2e): preserve useful UI P0 hardening

* test(e2e): remove retired Automations coverage

* test(e2e): retain Automations smoke coverage

Generated-By: looper 0.11.8 (runner=fixer, agent=codex)
This commit is contained in:
Amy
2026-08-07 08:21:48 +00:00
committed by GitHub
parent f4b242d66c
commit e01efc78f6
15 changed files with 134 additions and 3027 deletions
@@ -1,317 +0,0 @@
# Automations 当前自动化覆盖清单
## 概述
这份文档用于说明 `Automations` 页面及其核心运行链路,**当前已经有哪些自动化覆盖**,以及**还剩哪些空缺**。
覆盖范围按 3 层拆分:
- `组件/单测`
- `页面级 E2E`
- `tools-dev / non-UI 回归`
本文只统计当前仓库 `open-design-amr-runtime-acp` 里已经落地并可执行的自动化,不包含钱包、Stripe 或其他仓库页面。
## 当前已覆盖
### 1. 组件 / 单测
#### [TasksView.page.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/TasksView.page.test.tsx)
已覆盖:
- `Automations` 页面骨架渲染
- hero 标题、副标题、统计区
- `Active / Paused / Templates` 统计展示
- 空态展示
- 从空态打开 `New automation`
- 从顶部按钮打开 `New automation`
- 模板分类切换到空分类时的空态
- `Run`
- `Pause / Resume`
- `Delete`
- `Open result`
- `History / Hide history`
- `Edit` 预填
- template filter 的 `aria-selected` 切换
#### [TasksView.history.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/TasksView.history.test.tsx)
已覆盖:
- 历史运行信息展示
- `Open conversation`
- 历史视图中的元信息
- 从列表 `Edit` 打开预填弹窗
#### [TasksView.templates.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/TasksView.templates.test.tsx)
已覆盖:
- daemon automation templates 渲染
- 从 template 卡片打开创建弹窗
- evolution proposals 展示与应用
- source ingestion 基本链路
#### 相关旧测试
- [RoutinesSection.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/RoutinesSection.test.tsx)
说明:
- 这是旧的 routines surface 测试
- 仍覆盖部分基础动作,例如创建、暂停、运行、删除
- 但当前主页面已经是 `TasksView`,所以后续应优先看 `TasksView.*` 测试
### 2. 页面级 E2E
#### [automations-page.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/ui/automations-page.test.ts)
已覆盖 9 条页面级 smoke / regression:
- 页面加载:hero、统计区、filter、已保存列表
- 创建 automation 后从页面运行
- 创建失败时 modal 保持打开且输入不丢
- `Run` 失败时页面错误展示与 row 仍可操作
- `Pause / History / Delete` 主链路
- `Pause` 失败态
- `Delete` 失败态
- `Edit` 保存后列表更新
- 模板 filter 切换后页面内容变化
#### [settings-memory-routines.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/ui/settings-memory-routines.test.ts)
已覆盖:
- 从主 `Automations` surface 创建 automation
- 运行 automation 跳转到项目对话
- 创建失败时 modal 保持打开
说明:
- 这部分和 `automations-page.test.ts` 有一定重叠
- 但它更像 Settings / Memory 混合场景下的回归
### 3. tools-dev / non-UI 回归
#### [routines.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/lib/vitest/routines.ts)
已提供 helper:
- `listRoutines`
- `createRoutine`
- `updateRoutine`
- `runRoutine`
- `deleteRoutine`
#### [automations-routines.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/tests/tools-dev/automations-routines.test.ts)
已覆盖 2 条核心非 UI 回归:
- 成功链路
- `create`
- `list`
- `pause / resume`
- `run succeeded`
- `assistant message`
- `lastRun`
- `delete`
- 失败链路
- `run failed`
- `assistant message.runStatus = failed`
- `lastRun.status = failed`
- `lastRun.error` 已持久化
## 当前已形成的覆盖矩阵
### 页面展示
已覆盖:
- 页面可加载
- 统计区可见
- 空态可见
- filter/tab 状态切换
- 列表项主按钮可见
### 主操作
已覆盖:
- `New automation`
- `Edit`
- `Run`
- `Pause / Resume`
- `Delete`
- `Open result`
- `History`
### 失败态
已覆盖:
- 创建失败
- 运行失败
- Pause 失败
- Delete 失败
- run 失败后的 `assistant message` 与 `lastRun` 持久化
### 数据层 / 契约层
已覆盖:
- `/api/routines` create/list/update/delete/run 主链路
- `lastRun` 成功持久化
- `lastRun` 失败持久化
- 非 UI 运行结果与消息状态一致
## 仍然存在的空缺
下面这些还没有形成完整自动化,或者只被部分覆盖。
### 1. Edit 失败态
当前缺少:
- 编辑保存失败时 modal 是否保持打开
- 已输入修改是否保留
- 错误提示是否明确
建议优先级:`P1`
### 2. History 失败态
当前缺少:
- 拉取 history 接口失败时的页面表现
- history 空态与失败态是否区分
建议优先级:`P1`
### 3. Source ingestion 的页面级 E2E
当前组件测试已覆盖部分逻辑,但页面级 E2E 还缺:
- ingest 成功
- ingest 失败
- proposals 在页面上的联动
建议优先级:`P1`
### 4. Evolution proposals 的页面级 E2E
当前缺少:
- proposal 可见性
- `Apply`
- `Reject`
- proposal 数量变化
建议优先级:`P1`
### 5. 更细的错误恢复
当前缺少:
- `Run` 失败后再次成功运行
- `Pause` 失败后再次点击恢复成功
- `Delete` 失败后重试删除成功
建议优先级:`P2`
### 6. 并发 / 防重入
当前缺少:
- 连点 `Run`
- 连点 `Pause`
- 连点 `Delete`
建议优先级:`P2`
### 7. 多语言 / 文案变体
当前覆盖主要以当前默认界面为准,缺少:
- 中文 / 英文切换下关键入口是否仍稳定
建议优先级:`P2`
## 推荐优先级
### P0
已覆盖完成:
- 页面加载
- 新建
- 运行
- 暂停 / 恢复
- 删除
- 编辑
- 运行失败
- 暂停失败
- 删除失败
- tools-dev 成功 / 失败主链路
### P1
建议下一步补:
- Edit 失败态
- History 失败态
- proposals 页面级 E2E
- source ingestion 页面级 E2E
### P2
可后续补:
- 防重入
- 重试恢复
- 多语言稳定性
## 推荐执行命令
### 组件测试
```bash
cd /Users/mac/open-design/open-design-amr-runtime-acp
pnpm --dir apps/web test -- \
tests/components/TasksView.page.test.tsx \
tests/components/TasksView.history.test.tsx \
tests/components/TasksView.templates.test.tsx
```
### 页面级 E2E
```bash
cd /Users/mac/open-design/open-design-amr-runtime-acp/e2e
pnpm exec playwright test -c playwright.config.ts ui/automations-page.test.ts
```
### tools-dev / non-UI
```bash
cd /Users/mac/open-design/open-design-amr-runtime-acp/e2e
pnpm test tests/tools-dev/automations-routines.test.ts
```
## 结论
当前 `Automations` 这一块已经不是“只有页面能点点看”的状态,而是已经形成了:
- `组件级`
- `页面级 E2E`
- `非 UI 契约级`
三层覆盖。
如果按回归价值看,当前最值得继续补的不是再堆更多 happy path,而是:
- `Edit` 失败态
- `History` 失败态
- `Source ingestion / proposals` 的页面级 E2E
这三块补完后,`Automations` 页面自动化会更接近完整回归集。
@@ -1,149 +0,0 @@
# Automations 页面自动化待补清单
## 说明
本文档针对 `/automations` 页面整理自动化测试缺口,目标是把当前“有零散组件测试、但缺页面级覆盖”的状态收敛成一个可执行清单。
适用范围:
- `Automations` 页面本身
- 列表卡片区
- 页面级筛选与分类
- `New automation` 页面入口
- 页面内的 `Run / History / Edit / Pause / Delete / Open result`
当前边界:
- 已有部分组件测试覆盖 `RoutinesSection`、`TasksView.history`、`NewAutomationModal`。
- 当前仓库内**还没有看到这整个页面的完整 E2E 覆盖**。
- 本文档优先补“页面真实使用路径”,而不是重复已有纯函数或小组件断言。
## 现有覆盖概览
当前已存在、与这页有关的测试主要有:
- [RoutinesSection.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/RoutinesSection.test.tsx)
覆盖部分自动化列表区和 `New automation` 入口行为。
- [TasksView.history.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/TasksView.history.test.tsx)
覆盖 automation history 相关行为。
- [NewAutomationModal.context-picker.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/NewAutomationModal.context-picker.test.tsx)
覆盖创建弹窗里的 prompt/context picker。
- [router-marketplace.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/router-marketplace.test.ts)
覆盖 `/automations` 路由解析。
仍明显缺失的,是你截图这个页面本身的:
- 页面加载
- 顶部统计
- 卡片操作
- 页面级筛选
- “Open result” 链路
- 页面入口到弹窗/编辑页的完整串联
## P0
这些是最值得先补、最容易出真实回归事故的页面级能力。
| ID | 模块 | 待补自动化点 | 推荐层级 | 说明 |
| --- | --- | --- | --- | --- |
| AUTO-P0-001 | 页面加载 | `/automations` 页面可正常进入,标题、副标题、`New automation` 按钮可见 | E2E UI | 守住页面可达性和基本骨架 |
| AUTO-P0-002 | 顶部统计 | `Active / Paused / Templates` 三个统计块正常渲染 | 组件测试 + E2E UI | 至少校验数值显示与空态不炸 |
| AUTO-P0-003 | 列表加载 | `Your automations` 列表可渲染多条记录 | E2E UI | 覆盖成功、失败、暂停等不同状态卡片 |
| AUTO-P0-004 | 状态 badge | `FAILED / SUCCEEDED / PAUSED` badge 正确显示 | 组件测试 | 防止状态串文案、串颜色、串按钮 |
| AUTO-P0-005 | `New automation` 入口 | 点击 `New automation` 能打开创建弹窗/流程 | E2E UI | 守住最核心入口 |
| AUTO-P0-006 | `Run` 操作 | 点击 `Run` 后状态刷新,最近运行信息更新 | E2E UI | 用户最直接的主操作之一 |
| AUTO-P0-007 | `Pause` 操作 | 点击 `Pause` 后状态与按钮文案更新 | E2E UI | 防止暂停后还显示 active |
| AUTO-P0-008 | `History` 入口 | 点击 `History` 能打开历史视图/面板 | 组件测试 + E2E UI | 至少验证入口可达 |
| AUTO-P0-009 | `Edit` 入口 | 点击 `Edit` 能进入编辑状态或编辑弹窗 | E2E UI | 防止编辑入口断链 |
| AUTO-P0-010 | `Delete` 操作 | 删除入口可达,确认后列表移除 | E2E UI | 高风险破坏性操作,必须单测到 |
## P1
这些属于第二层回归,建议在页面主链路补齐后继续补。
| ID | 模块 | 待补自动化点 | 推荐层级 | 说明 |
| --- | --- | --- | --- | --- |
| AUTO-P1-001 | `Open result` | 成功 run 有结果时可打开结果页 | E2E UI | 守住成功产物可追溯 |
| AUTO-P1-002 | 失败结果 | 失败 run 的 `Open result` 行为正确,不假装有结果 | E2E UI | 防止死链或错误跳转 |
| AUTO-P1-003 | 顶部筛选 | `Active / Paused / Templates` 切换后列表正确过滤 | 组件测试 + E2E UI | 覆盖页面级聚合筛选 |
| AUTO-P1-004 | 底部分类 | `All / Orbit / Live artifacts / Memory / ...` 分类切换正确 | E2E UI | 贴近截图中的模板分类条 |
| AUTO-P1-005 | 列表时间信息 | `Last run / Next run` 时间展示正确 | 组件测试 | 防止时区、格式或排序回归 |
| AUTO-P1-006 | `Run` 防重入 | 连点 `Run` 不应产生并发重复执行 | 组件测试 + E2E UI | 防止重复触发 |
| AUTO-P1-007 | `Pause` 防重入 | 连点 `Pause` 不会出现状态错乱 | 组件测试 | 防止 UI/接口竞态 |
| AUTO-P1-008 | 创建成功回填 | 新建 automation 后统计数字和列表一起刷新 | E2E UI | 覆盖页面级一致性 |
| AUTO-P1-009 | 编辑成功回填 | 编辑后卡片标题、频率、下一次运行时间更新 | E2E UI | 覆盖编辑结果回流 |
## P2
这些更偏兜底与稳定性,适合在主链路稳定后补充。
| ID | 模块 | 待补自动化点 | 推荐层级 | 说明 |
| --- | --- | --- | --- | --- |
| AUTO-P2-001 | 空态 | 没有 automations 时的空态渲染正确 | 组件测试 + E2E UI | 防止空页布局坏掉 |
| AUTO-P2-002 | 接口失败 | 列表加载失败时有明确错误或降级 | 组件测试 | 防止白屏 |
| AUTO-P2-003 | 单操作失败 | `Run / Pause / Delete / Edit` 请求失败时提示明确 | 组件测试 + E2E UI | 防止静默失败 |
| AUTO-P2-004 | 本地化 | 中文/英文下按钮、状态、统计布局正常 | E2E UI | 防止文案切换后布局溢出 |
| AUTO-P2-005 | 长列表 | 多条 automation 时滚动与分页/截断正常 | E2E UI | 防止页面退化 |
| AUTO-P2-006 | 模板统计边界 | 模板数量为 0 或很多时顶部统计仍正确 | 组件测试 | 覆盖计数边界 |
## 建议测试文件落点
### 组件测试
- [TasksView.history.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/TasksView.history.test.tsx)
继续扩展 `History` 相关断言。
- [RoutinesSection.test.tsx](/Users/mac/open-design/open-design-amr-runtime-acp/apps/web/tests/components/RoutinesSection.test.tsx)
可继续扩展列表加载、空态、状态 badge、`New automation` 按钮。
- 建议新增:
- `apps/web/tests/components/TasksView.list.test.tsx`
- `apps/web/tests/components/TasksView.filters.test.tsx`
- `apps/web/tests/components/TasksView.actions.test.tsx`
### E2E UI
建议新增:
- `e2e/ui/automations-page.test.ts`
- 页面加载
- 标题/统计
- 列表渲染
- 顶部/底部筛选
- `e2e/ui/automations-actions.test.ts`
- `Run / History / Edit / Pause / Delete`
- `Open result`
- `e2e/ui/automations-create-flow.test.ts`
- `New automation`
- 创建成功后回填列表
## 推荐补测顺序
1. 页面基础骨架
先补 `AUTO-P0-001`、`AUTO-P0-002`、`AUTO-P0-003`
2. 卡片主操作
再补 `AUTO-P0-006`、`AUTO-P0-007`、`AUTO-P0-008`、`AUTO-P0-009`、`AUTO-P0-010`
3. 创建入口
再补 `AUTO-P0-005`
4. 筛选与结果页
再补 `AUTO-P1-001`、`AUTO-P1-002`、`AUTO-P1-003`、`AUTO-P1-004`
5. 稳定性与边界
最后补 `AUTO-P2-*`
## 最值得先实现的 5 条
如果只优先做最有价值的 5 条,我建议是:
1. `AUTO-P0-001` `/automations` 页面加载成功
2. `AUTO-P0-005` `New automation` 入口可打开
3. `AUTO-P0-006` `Run` 操作后状态刷新
4. `AUTO-P0-007` `Pause` 操作后状态刷新
5. `AUTO-P1-003` 顶部筛选切换后列表正确变化
## 后续建议
这页最适合的策略不是一开始就做很重的全链路,而是:
- 先用组件测试守住状态展示和局部交互
- 再用 2 到 3 个 E2E 文件守住页面入口和核心动作
- 最后再补异常态、防重入和本地化
这样补起来更快,也更不容易被页面文案或布局小改动拖垮。
@@ -94,23 +94,7 @@
- `web/latest.log`
- `desktop/latest.log`
### 6. Automations 页面顺序与摘要
文件:
- [e2e/ui/automations-page.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/ui/automations-page.test.ts)
新增用例:
1. `places a newly created automation at the top of the list and highlights it`
- 覆盖新建后置顶与聚焦态
2. `keeps saved automations ordered by newest createdAt first`
- 覆盖多条 automation 混排时按 `createdAt` 倒序稳定排序
3. `renders the routine target and last-run status in the row summary`
- 覆盖 row summary 的 target / status 信息
### 7. Integrations:连接、恢复、退化状态
### 6. Integrations:连接、恢复、退化状态
文件:
- [e2e/ui/settings-connectors-auth-happy-path.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/ui/settings-connectors-auth-happy-path.test.ts)
@@ -129,7 +113,7 @@
4. `returns a pending authorization to Connect and clears session storage after a successful cancel`
5. `surfaces a connector error state when credentials have degraded`
### 8. Design systems:Settings 导入/重命名/坏导入
### 7. Design systems:Settings 导入/重命名/坏导入
文件:
- [e2e/ui/settings-design-systems.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/ui/settings-design-systems.test.ts)
@@ -140,7 +124,7 @@
2. `renames an editable design system and keeps the new title after reopening settings`
3. `shows an inline error when importing a broken local design system package`
### 9. Design systems manager:发布、过滤、删除 fallback
### 8. Design systems manager:发布、过滤、删除 fallback
文件:
- [e2e/ui/design-systems-manager.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/ui/design-systems-manager.test.ts)
@@ -151,7 +135,7 @@
2. `filters user design systems by draft and published status in the manager`
3. `deleting the active design system falls back to another user system`
### 10. main 最新功能回归补测
### 9. main 最新功能回归补测
文件:
- [e2e/ui/project-management-flows.test.ts](/Users/mac/open-design/open-design-amr-runtime-acp/e2e/ui/project-management-flows.test.ts)
@@ -234,13 +218,6 @@ pnpm exec playwright test -c playwright.config.ts ui/app.test.ts --grep "sending
pnpm exec playwright test -c playwright.config.ts ui/diagnostics-export.test.ts
```
### Automations
```bash
pnpm exec playwright test -c playwright.config.ts ui/automations-page.test.ts --grep "places a newly created automation at the top of the list and highlights it|keeps saved automations ordered by newest createdAt first|renders the routine target and last-run status in the row summary"
```
### main 最新功能回归补测
```bash