automated email testing

Verify a password-reset flow through a real test inbox

Route a reset email to a receive-only inbox, wait for the matching message, then use its link to check the full reset path without fixed sleeps.

By Wesley Copley·November 13, 2026·4 min read
What matters here
  1. A reset-email test can wait for a matching message for up to 180 seconds instead of sleeping for a fixed interval.
  2. InboxRhino test inboxes receive mail only; your application must send the password-reset message.
  3. The free tier allows 11 active inboxes and 33 inbound emails per month, so plan test volume accordingly.

Password-reset tests often fail for a simple reason: the test checks the inbox before the application has sent the email. A fixed sleep makes the suite slower when delivery is quick and still unreliable when it is not. A better flow gives each test a receiving address, waits for the expected message, and then exercises the reset link in a browser.

InboxRhino provides receive-only MX inboxes at test.inboxrhino.in. Its API can wait for a message for up to 180 seconds and filter by subject or sender. The inbox cannot send, reply to, or forward email, so your application’s normal reset-email path must deliver the message to the test address.

Set up the test boundary

First, make the test environment send password-reset email to an address you control for the test. Keep the application’s usual reset flow intact: submit a known test account, allow the app to generate its reset message, and verify that message through the inbox API. Don’t replace the flow with a direct call to the mail provider if the goal is to test the whole application path.

Create a test inbox through the InboxRhino API. The documented quickstart uses a POST request to https://api.inboxrhino.in/v1/inboxes with a bearer API key and reads the new inbox ID from the response. Use the returned address as the destination for the reset request. Keep credentials in your test environment rather than hard-coding them in a test file.

For parallel tests, avoid having several reset flows compete for messages in one shared inbox. Separate inboxes make it easier to match a message to the test that triggered it. Account for the service’s quotas when deciding how many inboxes and reset attempts to create. The free tier includes 11 active inboxes and 33 inbound emails per month; Starter is available with an access code and includes 1,100 active inboxes and 3,300 emails per month.

Wait for the reset email

After submitting the reset request in your browser test, ask the API to wait for a message. Set a subject filter that matches the reset message your application actually sends. If the sender is stable in the test environment, filter by sender as well. These filters reduce the chance that an unrelated message will satisfy the test.

The InboxRhino quickstart demonstrates a request to the inbox’s messages endpoint with wait_seconds=180, limit=1, include=content, and a subject filter. Adapt the subject to your own email template, and consult the API documentation for the response fields used by your test. The wait is bounded: it can run for up to 180 seconds, not indefinitely.

Assert that a matching message arrived before proceeding. If it did not, fail with enough context to investigate, such as the inbox used and the reset request that was made. Avoid retrying the entire reset flow automatically without considering side effects: it may create multiple valid reset messages and leave the test unsure which link to use.

Use the message to finish the browser test

Read the returned message content and identify the reset URL according to the format your application sends. Then navigate the browser to that URL and check the important outcomes: the reset page loads, an invalid or expired token is rejected where applicable, and a valid token allows the test account to set a new password. Finally, verify the application’s post-reset behavior, such as whether the new password can be used to sign in.

Keep the email assertion separate from the browser assertions. That distinction helps locate failures: a missing message points toward the reset request, delivery configuration, or message filter; a broken URL or reset page points further along the flow. Teams using Playwright can also consult InboxRhino’s earlier guide to replacing fixed sleeps with bounded email polling for practical context on making these checks more predictable.

Keep the test safe and repeatable

If a message needs visual inspection, InboxRhino’s sandboxed email viewer blocks scripts, forms, popups, and remote images. That is useful for reviewing HTML without treating the preview as a normal browser page. The viewer is for inspection; use your application’s browser flow to test the reset URL itself.

InboxRhino retains emails for 30 days before deletion. Don’t make a test depend on an old message: create a fresh reset request and match its expected subject or sender. Also remember that the inbox is receive-only. The test should interact with your application to request and complete the reset, not try to reply to the email address.

The result is a focused end-to-end check: the app accepts a reset request, the expected email reaches a real receiving address, and the link leads to a working password change. Bounded polling replaces guesswork, while a distinct inbox and message filter help keep concurrent runs from borrowing one another’s mail.

More from InboxRhino News