Files
.pouch/skills/tester/references/maintain.md
T

40 lines
1.9 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.
# tester 维护用例
只在用户要加、改、退役时读本文件。写之前必须把完整条目亮给用户,确认后再落盘。
## 加一条
1. 分类必须已在 `catalog.yaml` 的 `categories` 里。没有就先改 catalog(仍要确认)。
2. 取编号:
```bash
python3 <skill-dir>/scripts/catalog.py next-id --root <root> --category <CAT>
```
3. 拟一条符合 [schema.md](schema.md) 的用例。`tag`/`risk` 按 [levels.md](levels.md):`smoke` 只能 `readonly`;会改状态用 `mutating`,难恢复用 `destructive`。细分授权用 `gate`,不要发明新的 risk 名。需人工参与的填 `automation`(见 [concepts.md](concepts.md))。
4. `driver=browser|mobile` 必须填 `session`,且 catalog 里已声明。
5. `what` 和 `expected` 写成可观察信号,禁止「应该正常」。
6. 给用户看拟写内容。确认后写入 `cases/<category小写>.yaml` 的 `cases` 列表末尾。
7. `validate`。失败则修好再结束。通过后跑 `generate_cases_csv.py --root <root>` 刷新 `.pouch/tester/cases.csv`。不要手改这份 CSV。
## 完善 / 更新
1. `show --id <id>`。
2. 只改用户点名的字段(常见:`how`、`expected`、`risk`、`automation`、`notes`)。
3. 展示 diff 或更新后的整条。确认后写回。
4. `validate`。通过后跑 `generate_cases_csv.py` 刷新 `cases.csv`。
## 退役
把 `lifecycle` 改为 `retired`,不要删文件、不要复用 id。`notes` 写原因。确认后写回,再跑 `generate_cases_csv.py`。
## 禁止
- 未确认就写
- 把 browser/mobile 改成 script 来「省事」
- 为了能在默认风险下跑而把 `risk` 改低
- 一次塞进无关的一批用例
- 手改 `runs/` 冒充执行记录
- 手改 `cases.csv`(必须从 `cases/*.yaml` 生成;运行结果只在对应 `runs/<run-id>.*` 中保存)
- 手改 `runs/*.csv`(必须从对应 yaml 用 `generate_run_csv.py` 生成)