replica-test
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesereplica-test
replica-test
Reads the flows in . Writes ,
, and end-to-end tests in the project (). Templates in
this folder: , , .
replica/recon.mdreplica/test-plan.mdreplica/bugs.mde2e/test-plan.mdbug-report.mde2e.example.spec.ts读取 中的流程。写入 、
,以及项目中的 end-to-end 测试()。本文件夹中的模板:
、、。
replica/recon.mdreplica/test-plan.mdreplica/bugs.mde2e/test-plan.mdbug-report.mde2e.example.spec.tsThe rule
规则
Test your clone, not the original. Never load test, fuzz, script or
hammer the original app's servers. Using the original by hand, as a normal
user, to see how it behaves is fine.
测试你的克隆版本,而不是原版。 绝不对原应用的服务器执行 load test、
fuzz、脚本测试或高频请求。以普通用户的身份手动使用原版来观察其行为则无妨。
Step 1: the plan
第 1 步:制定计划
For every flow F01, F02... in the recon map, write:
- Happy path: the steps, and what the user should see at the end.
- Edge cases that apply. Go down this list for every flow: empty input, very long input, emoji and accents, two tabs at once, double click on submit, back button mid-flow, refresh mid-flow, slow network, offline, expired session, second user's data (must be invisible), time zones and daylight saving, mobile width, keyboard only, screen reader labels.
- Negative cases: wrong password, card declined (Stripe test card
), permission denied, deleted record.
4000 0000 0000 0002
Number every case: F01-H1, F01-E3, F01-N2.
对于 recon 映射图中的每个流程 F01、F02...,编写:
- Happy path(正向路径):操作步骤,以及用户最终应看到的内容。
- Edge cases(边界情况):适用于该流程的情况。对每个流程逐一检查以下列表: 空输入、超长输入、emoji 和重音字符、同时打开两个标签页、 双击提交、流程进行到一半时点击返回按钮、流程进行到一半时刷新、慢速 网络、离线、会话过期、另一位用户的数据(必须不可见)、 时区和夏令时、移动端宽度、仅使用键盘、屏幕阅读器 标签。
- Negative cases(负向用例):密码错误、银行卡支付被拒(Stripe 测试卡
)、权限被拒、记录已删除。
4000 0000 0000 0002
为每个用例编号:F01-H1、F01-E3、F01-N2。
Step 2: automate what you can
第 2 步:尽可能自动化
Playwright, one spec per flow, against the local dev server with seed data.
Use roles and labels for selectors (),
never CSS classes. See .
getByRole('button', { name: 'Book' })e2e.example.spec.tsbash
npm i -D @playwright/test && npx playwright install chromium
npx playwright testAdd to every spec: fail on console errors, fail on any 5xx response, and an
axe accessibility scan () on each screen.
@axe-core/playwright针对本地开发服务器并使用 seed 数据,每个流程编写一个 Playwright spec。
选择器使用 role 和 label(),
绝不使用 CSS class。参见 。
getByRole('button', { name: 'Book' })e2e.example.spec.tsbash
npm i -D @playwright/test && npx playwright install chromium
npx playwright test在每个 spec 中加入:遇到 console 错误时失败、任何 5xx 响应时失败,以及对每个
页面执行 axe 可访问性扫描()。
@axe-core/playwrightStep 3: click through the rest
第 3 步:手动检查其余内容
What cannot be automated (emails arriving, OAuth with real providers,
payments end to end, visual glitches) gets a manual pass. If a browser tool is
available, drive the local clone with it and screenshot each step. Otherwise
give the user the checklist and wait for answers.
无法自动化的内容(邮件到达、使用真实提供商进行 OAuth、
end-to-end 支付、视觉异常)需进行人工检查。如果有浏览器工具,
就用它操作本地克隆版本,并为每一步截图。否则
向用户提供检查清单并等待答复。
Step 4: report bugs
第 4 步:报告缺陷
Every bug goes in in the format: an ID, a
severity, exact steps, expected, actual, evidence. Severity:
replica/bugs.mdbug-report.md| means | |
|---|---|
| S1 | data loss, security hole, payments wrong, core flow blocked |
| S2 | a feature broken, no workaround |
| S3 | broken with a workaround, or visibly wrong |
| S4 | cosmetic |
Only report what you reproduced. "Might be an issue" goes in a separate
"to check" list.
每个缺陷都应写入 ,并采用 格式:ID、
严重程度、准确复现步骤、预期结果、实际结果、证据。严重程度:
replica/bugs.mdbug-report.md| 含义 | |
|---|---|
| S1 | 数据丢失、安全漏洞、支付异常、核心流程受阻 |
| S2 | 某项功能损坏且无变通方案 |
| S3 | 功能损坏但有变通方案,或显示明显异常 |
| S4 | 外观问题 |
仅报告已复现的问题。“可能存在问题”的内容放入单独的
“待检查”列表。
Step 5: fix loop
第 5 步:修复循环
Fix S1 and S2 first. For every fix: write the failing test first, fix, watch
it pass, keep the test. Re-run the whole suite after each batch. Update
with the commit that fixed each one.
bugs.md优先修复 S1 和 S2。每次修复都要先编写失败测试,然后修复,确认
测试通过,并保留该测试。每批修复后重新运行整个测试套件。更新
,记录修复每个缺陷所对应的 commit。
bugs.mdOutput
输出
test-plan.mdbugs.md/replica-difftest-plan.mdbugs.md/replica-diff