Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Playwright Email Tests Need a Signal Boundary

说明与用途

Playwright 邮件验证测试因单一等待导致易失,隐藏了交付、选择和消费的独立失败。通过分离信号、使用唯一运行 ID 和有限超时,可提升可靠性和诊断能力。

问题

Email verification tests become flaky because a single timeout hides independent failures in delivery, selection, and consumption steps.

结果

Tests become more reliable and diagnosable by separating signals, using unique correlation values, and providing bounded timeouts with detailed error output.

工作流

  • Generate a unique run ID before form submission
  • Create a test email address via inbox client with the run ID
  • Fill the email field and submit the form
  • Wait for a verification message matching the run ID and subject
  • Assert the verification URL contains "/verify"
  • Navigate to the verification URL
  • Assert the page shows "Email verified"

证据

The application may queue a message, a provider may deliver it later, and the inbox API may return messages from a previous run.

来源

The goal is not to retry everything. The goal is to know whether the message was never created, was created but not visible, or was consumed by the wrong test.

来源

A useful contract is: create a unique mailbox or test address for the run; expose a stable correlation value, such as a run ID; poll only for messages matching that value; return the message ID and verification URL as separate fields; record when the message was claimed and when the token was consumed.

来源

  • 记录日期: 2026-10-14T21:55:55.308Z