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:
2026-08-03 08:36:50 +08:00
parent 602ed6a671
commit 3e93317988
6 changed files with 427 additions and 19 deletions
+7
View File
@@ -45,6 +45,13 @@
- 修复 use-reduced-motion.ts ESLint 错误(set-state-in-effect
- 新增 UJ-10 深度搜索者旅程(分类浏览 → 逐篇阅读 → 内容发现)
- 测试债务追踪板同步更新,UJ-10 已解决,UJ-03/06/07 标记为环境依赖
- 2026-08: **Admin 用户旅程修复完成** — test-strategy-plan.md 版本 2.1
- 修复 `loginAdminAndSetCookie` 函数,同步设置 cookie 和 localStorage 解决认证问题
- 更新 Playwright webServer 配置为 `npm run dev` 以支持 API 路由
- UJ-03/UJ-06/UJ-07 共 9 个 admin 测试在 chromium/firefox/webkit 全部通过
- 修复 UJ-10 CSS 选择器解析问题(`text=` 正则与 CSS 混用)
- 修复 cases-filter 测试 locator 不稳定问题(`getByRole('radio')``locator('button[role="radio"]')`
- 200 个回归测试全部通过
## 项目进度