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
+3 -1
View File
@@ -102,7 +102,9 @@ export default defineConfig({
},
],
webServer: {
command: 'npm run preview',
// 使用 dev server 以支持 API 路由(admin 用户旅程等测试需要)
// 若只运行非 API 测试(如 @journey @regression),可手动启动 npm run preview 并设置 reuseExistingServer: true
command: 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: true,
timeout: 120000,