f6ecdf224e
- Document running playwright tests locally against moicen before pushing - Helps avoid wasted CI cycles Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
huike-e2e-moicen 项目指南
本地执行 E2E 测试(先本地,再 CI)
推送前先在本机对 moicen 测试服执行 Playwright 测试,避免反复推送等 CI 结果:
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 在后台检测,不要轮询:
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 "已登录") |