fix(e2e): resolve admin user journey authentication and stabilize flaky tests
- Fix loginAdminAndSetCookie to set both cookie (middleware) and localStorage (auth-context)
- Add page navigation before localStorage evaluate to avoid SecurityError
- Update Playwright webServer to npm run dev for API route support
- Fix UJ-10 CSS selector parsing error (text= regex mixed with CSS)
- Fix cases-filter flaky test (getByRole('radio') → locator('button[role="radio"]'))
- Update test-strategy-plan.md: mark UJ-03/06/07 as ✅ completed
- Update README.md with admin fix progress record
This commit is contained in:
@@ -767,7 +767,7 @@ Phase 1 (2周) Phase 2 (3周) Phase 3 (3周) Phase 4 (2周)
|
||||
| 任务 | 描述 | 交付物 | 预估工时 |
|
||||
|------|------|--------|----------|
|
||||
| P3.1 | 开发用户旅程测试框架 | 旅程执行器 + 步骤验证器 — 已完成 ✅(UJ-01/UJ-02) | 2d |
|
||||
| P3.2 | 编写 10 个用户旅程测试 | UJ-01 到 UJ-10 — 已完成 ✅ UJ-01/UJ-02/UJ-04/UJ-05/UJ-10,⏳ UJ-03/UJ-06/UJ-07 需 admin 环境 | 5d |
|
||||
| P3.2 | 编写 10 个用户旅程测试 | UJ-01 到 UJ-10 — 已完成 ✅ 全部 10 个用户旅程(UJ-01~UJ-10) | 5d |
|
||||
| P3.3 | 补充 E2E 测试 | 移动端 E2E、错误页面、键盘导航 — 已完成 ✅(16 个移动端测试,`e2e/mobile.spec.ts`) | 3d |
|
||||
| P3.4 | 补充 GA4 事件追踪测试 | 网络拦截验证事件参数 — 已完成 ✅(4 个测试用例,`e2e/ga4-event-tracking.spec.ts`) | 2d |
|
||||
| P3.5 | 修复 k6 压力测试脚本 | 适配混合渲染模式 — 已完成 ✅(扩展为 6 页面测试,添加分页统计) | 1d |
|
||||
@@ -1185,9 +1185,9 @@ Lint + TS +Unit +集成 +E2E +变异
|
||||
│ ├── [P2] UJ-05: 案例浏览者筛选旅程 ✅ 已实现(e2e/user-journey.spec.ts)
|
||||
│ ├── [P2] UJ-08: 移动端用户旅程 ✅ 已覆盖(e2e/mobile.spec.ts,@mobile 标签,16 个用例)
|
||||
│ ├── [P2] UJ-09: 错误恢复旅程 ✅ 已覆盖(e2e/p5-edge-cases.spec.ts 含 404 导航测试)
|
||||
│ ├── [P2] UJ-03: 内容管理员完整旅程 ⏳ 待补充(需 admin 认证环境)
|
||||
│ ├── [P2] UJ-06: 多角色管理员权限旅程 ⏳ 待补充(需 admin 认证环境)
|
||||
│ ├── [P2] UJ-07: 媒体管理员上传旅程 ⏳ 待补充(需 admin 认证环境)
|
||||
│ ├── [P2] UJ-03: 内容管理员完整旅程 ✅ 已实现(e2e/user-journey.spec.ts,含登录 → 仪表盘 → 内容管理 → 编辑 → 前台可见)
|
||||
│ ├── [P2] UJ-06: 多角色管理员权限旅程 ✅ 已实现(e2e/user-journey.spec.ts,含角色列表 → 用户列表 → API 验证)
|
||||
│ ├── [P2] UJ-07: 媒体管理员上传旅程 ✅ 已实现(e2e/user-journey.spec.ts,含媒体库 → 上传 → 验证 → 清理)
|
||||
│ └── [P2] UJ-10: 深度搜索者旅程 ✅ 已实现(e2e/user-journey.spec.ts)
|
||||
│
|
||||
├── P2 优先级 — 性能与质量缺口
|
||||
@@ -1225,7 +1225,7 @@ Lint + TS +Unit +集成 +E2E +变异
|
||||
│
|
||||
└── 附带说明
|
||||
├── 以上债务按优先级排列,P1 已全部解决
|
||||
├── P2 剩余项为 admin 环境依赖或低优先级功能
|
||||
├── P2 剩余项为低优先级功能(数据库查询性能基线)
|
||||
├── P3 项为环境限制,需升级工具链或采用替代方案
|
||||
└── 每次新功能开发应同步更新此追踪板
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user