feat: P1 合盘/星座/问答与测测完整设计包及模拟器取证工具

落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-03 11:37:53 +08:00
co-authored by Cursor
parent 15a9db374a
commit bd22d9dddd
248 changed files with 26309 additions and 842 deletions
+46 -9
View File
@@ -1,22 +1,59 @@
# Testing — Golden Rules
对照完成闸门:`.ai/definition-of-done.md` §4。
## Priority
Test money, scoring, auth, and unlock paths first.
先测:计分、权益(深度版/会员)、归属、支付 mock。
## Levels
| Level | Command / artifact | When |
|---|---|---|
| L0 Build | `go test ./...` · `npm run build:h5` | 每次声称可合并 |
| L1 Unit | Go engine `_test.go`H5 Vitest | 核心逻辑必有 |
| L2 Integration | `npm run test:api:integration`(需 Postgres | P1 关键流必有 |
| L3 E2E | `npm run test:e2e`Playwright,可用系统 Chrome | P1 收口至少 1 条 |
## Go
- Pure engines (decode / scale scoring) must have unit tests.
- `go test ./...` must pass before claiming API done.
```bash
npm run deps:up
cd apps/api && go test ./...
# 仅 L2
npm run test:api:integration
```
- Pure enginesportrait / relation)必须有 unit tests。
- L2 在 DB 不可用时 `Skip`;有 DB 时必须绿。
- `go test ./...` 失败 → 不得称 Backend Done。
### L2 覆盖的流
1. Profile → Portrait → deep_access pay-mock → detail
2. Two profiles → Relation insight → deep_access → tips
3. Membership pay-mock → `/membership/me` active → report detail
4. Profile → Ask thread → message → assistant reply + quota
H5 Vitest`PortraitPage` / `RelationPage` / `MembershipPage` / `AskPage`
## H5
- Critical utils may use Vitest when introduced.
- Until then: PR must list manual smoke steps for touched flows.
```bash
npm run test:h5 # Vitest
npm run build:h5 && npm run test:e2e # Playwright(默认 channel=chrome
```
## Definition for AI
- 关键页:`PortraitPage` / `RelationPage` / `MembershipPage` 有 Vitest。
- Playwright 画像主路径使用 network mock,不依赖 Go。
- 若无系统 Chrome`npx playwright install chromium` 后设 `PW_CHANNEL=` 空或删 channel。
- **仅 build 通过 ≠ Frontend Done。**
Do not mark a feature Done if:
## AI
- Scorable logic has zero tests, or
- Build is broken (`go test` / `npm run build:h5` fail).
不得在下列情况标记 Done
- 可计分逻辑零测试
- Build 红
- 无 L2 却宣称 P1 Complete
- 前端无 Loading/Empty/Error 却宣称页面 Done