Files
huike-e2e-moicen/CLAUDE.md
T
weli f6ecdf224e docs: add local E2E test workflow before CI push
- Document running playwright tests locally against moicen before pushing
- Helps avoid wasted CI cycles

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 20:16:04 +08:00

42 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# huike-e2e-moicen 项目指南
## 本地执行 E2E 测试(先本地,再 CI)
推送前先在本机对 moicen 测试服执行 Playwright 测试,避免反复推送等 CI 结果:
```bash
cd /Users/weli/works/huiwing-migration/huike-e2e-moicen
# 执行指定测试文件
npx playwright test tests/clazz-ui.spec.ts --reporter=list
# 执行全部测试
npx playwright test --reporter=list
# 带 UI 调试模式
npx playwright test --ui
```
测试通过后再 commit & push 触发远程 CI。
## CI 工作流
### 等待 CI 完成
使用 `gh run watch` 在后台检测,不要轮询:
```bash
gh run watch <run-id> --repo alchemy-studio/huike-e2e-moicen 2>&1 &
```
完成后会自动通知。也可以用 `gh run watch --job=<job-id>` 监控特定 job。
注意:`gh run watch` 依赖当前目录的 git remote 确定仓库,所以要在 `huike-e2e-moicen` 目录下跑,或者用 `--repo` 参数显式指定。
### 两个 Workflow
| Workflow | 环境 | 触发方式 | 测试范围 |
|----------|------|----------|----------|
| `music-room Playwright` | 测试服 (moicen.com) | push/PR 自动 + 手动 + 每日 06:30 UTC | 全部测试(含登录) |
| `production Smoke` | 正式服 (huiwings.cn) | 手动触发 + 每日 05:00 UTC | 仅访客测试(`--grep-invert "已登录"` |