playwright-qa

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Playwright QA Workflows

Playwright QA 工作流

For QA engineers: the work around the test code. What to test, how to report what broke, how to automate a manual suite, and how to judge a test.
4 guides. They build on the
core/
guides for the Playwright APIs and link to them rather than repeating them.
面向 QA 工程师:围绕测试代码开展工作,包括测什么、如何报告故障、如何将手动测试套件自动化,以及如何判断测试。
4 篇指南。这些指南以
core/
中关于 Playwright APIs 的指南为基础,并通过链接引用,而不重复其内容。

Guide Index

指南索引

What you're doingGuide
Ticket / PRD / acceptance criteria → test cases, risk ranking, test plan for the generatortest-design.md
Failing test → app bug, test bug or flake; bug report; what to do with the test meanwhilebug-reports.md
Manual test cases or a CSV export → Playwright specs with case IDsmanual-to-automated.md
Review Playwright tests or a PR; lint rules; prove a test can failtest-review.md
你正在做什么指南
工单 / PRD / 验收标准 → 测试用例、风险排序、供生成器使用的测试计划test-design.md
失败的测试 → 应用缺陷、测试缺陷或 flaky test;缺陷报告;等待修复期间如何处理该测试bug-reports.md
手动测试用例或 CSV 导出 → 带用例 ID 的 Playwright specsmanual-to-automated.md
审查 Playwright 测试或 PR;lint rules;证明测试能够失败test-review.md

Golden Rules

黄金法则

  1. Boundaries and negative paths first: bugs live at the edges of a rule, not in the happy path.
  2. Lowest layer that proves it: rules at API level, wiring and critical flows in E2E.
  3. Classify before filing: app bug, test bug, flake or environment; the trace usually decides.
  4. Frequency is a number:
    --repeat-each=20
    gives N/20, never "sometimes".
  5. Known bug →
    test.fail()
    with an issue link
    , never a deleted test or a loosened assertion.
  6. A test that can't fail guards nothing: break the feature once and watch it fail.
  7. Keep case IDs on automated tests so results map back to the manual suite.
  1. 优先关注边界条件和负向路径:缺陷存在于规则的边缘,而非 happy path。
  2. 采用能够证明问题的最低层级:规则在 API 层验证,连接关系和关键流程在 E2E 中验证。
  3. 提交前先分类:应用缺陷、测试缺陷、flake 或环境问题;通常由 trace 决定。
  4. 频率是一个数字:
    --repeat-each=20
    表示 N/20,绝不使用“有时”。
  5. 已知缺陷 → 使用
    test.fail()
    并附上 issue 链接
    ,绝不删除测试或放宽断言。
  6. 无法失败的测试无法提供任何保障:故意破坏一次功能,并观察测试失败。
  7. 在自动化测试中保留用例 ID,使测试结果能够映射回手动测试套件。