playwright-e2e-builderlisted
Install: claude install-skill ruhedanghaoyigexuesheng/autotest-skills
# Playwright UI 自动化 · 蓝图交付器
本 Skill 采用 **画像 → 蓝图 → 落地 → 验收** 四阶段交付,而非「扫描清单六步闭环」。
默认 Runner:**Playwright + TypeScript**
默认资产根目录:`qa/ui-automation/`
默认配置:`playwright.ui.config.ts`
Skill 路径:`.cursor/skills/playwright-e2e-builder/`
## 四阶段交付
| 阶段 | 动作 | 产出 |
|------|------|------|
| A 画像 | `profile_project.py` | `.qa/profile.json` |
| B 蓝图 | `build_blueprint.py` | `e2e-blueprint.json` + `locator-health.json` |
| C 落地 | Agent 写代码 | `qa/ui-automation/**` |
| D 验收 | 运行 + `quality_gate.py` + `triage_runs.py` | `quality-scorecard.json` + `run-triage.json` + `stakeholder-brief.md` |
## 阶段 A — 项目画像
```bash
python3 .cursor/skills/playwright-e2e-builder/scripts/profile_project.py \
--workspace . --emit .qa/profile.json --indent
```
记录 UI 栈、路由模块、API 模块、鉴权信号与推荐目录,**不生成用例**。
## 阶段 B — 测试蓝图
```bash
python3 .cursor/skills/playwright-e2e-builder/scripts/build_blueprint.py \
--workspace . \
--blueprint-out e2e-blueprint.json \
--locator-out locator-health.json \
--indent
```
- `e2e-blueprint.json`:screens / widgets / endpoints / journeys / candidateCases
- `locator-health.json`:定位健康指数与 `data-qa` 改造建议
**大规模写 case 前**,先与用户确认 blueprint 中的 urlPath 与业务命名。
定位策略(与通用 Playwright 指南不同,本 Skill 优先 `data-qa`):
1. `data-qa`(本 Skill 推荐前缀)
2. ARIA role + accessible name
3. label / placeholder
4. 稳定文案
5. 结构选择器(必须在 brief 中标注风险)
## 阶段 C — 资产落地
自 `assets/templates/` 生成:
| 模板 | 目标 |
|------|------|
| `playwright.ui.config.ts.template` | 根目录 Playwright 配置 |
| `screen-model.ts.template` |