Playwright Email Tests Need a Timing Probe
说明与用途
Playwright中的时间探针将延迟拆分为四个边界,帮助定位问题是出在应用、队列、邮箱还是浏览器。
问题
Email tests often fail with a generic timeout, hiding four distinct delays and making failures appear random.
结果
The probe provides clear boundaries for each delay, turning random timeouts into actionable diagnostics and reducing unnecessary retries.
工作流
- Record submittedAt when registration request completes
- Poll inbox for message with correlation token, record acceptedAt on first poll
- When message found, record foundAt
- Navigate to verification link and assert success, record verifiedAt
- Attach timing artifact to test report
证据
When all of those delays are hidden behind one timeout, a test failure look random.
The probe does not need a large observability platform. Start with a run ID and four timestamps:
Use a bounded poll with a clear interval, and capture the timing artifact whether the test passes or fails.
- 记录日期: 2026-10-27T21:11:13.547Z