Source: https://everyrole.dev/blog/forgot-password-test-cases

# Password reset test cases: the email, the link, the reuse

Password reset test cases for a forgot password flow: the request, the email, a link that works once and then expires, and an old password that stops working.

Nov 22, 2026  updated Nov 30, 2026  6 min read  by the EveryRole team

Password reset test cases, for any forgot password flow, are about one object: the link in the email. It has to work once. It has to stop working after that, and after a set time, and when a newer link exists. And when it has done its job, the old password must be dead. The lists we read test the form that asks for the link and stop when the email arrives. The bugs are in what the link still does afterwards.

Here is the list, in the order the link lives.

![The life of a reset link. Asked for: the page answers the same for any address. Sent: one email with a link to the live site. Used once: a new password is set and the old one stops working. From there on the link must be dead: refused when used a second time, when it is past its time, and after a newer link was asked for.](https://everyrole.dev/s/blog/forgot-password-test-cases/link-life.webp)

Three things the link must do, and three ways it must be dead. An honest note: our practice app has no password reset, so this post’s pictures are drawn, not photographed.

## 1. Asking for the link

| Case | What to do | What must come out |
| --- | --- | --- |
| A real account | The test account’s address | A message that a link was sent if the account exists. One email |
| No account | An address nobody registered | The same message, word for word. No email |
| Empty | Press the button with nothing typed | The form stays and says the address is missing |
| Wrong format | `not an email` | A message at the field |
| Asked twice | The same address, two requests | Two emails. Decide which link works: we say only the latest |
| Asked ten times | Ten requests in a minute | A limit, said in words. Not ten emails in someone’s inbox |
| From the login page | Press “Forgot password?” after a wrong password | The request page opens, with the address carried over if you decided it should be |

The second row is the one to look at twice.

![The reset page asked about an address with no account, drawn two ways. The first answers "No account with this email address." The second answers "If this address has an account, a reset link is on its way."](https://everyrole.dev/s/blog/forgot-password-test-cases/same-answer.webp)

The first answer lets anyone find out who has an account. The second gives nothing away.

Compare the two answers the way a script would: the words, the status code, and roughly how long each took. If any of the three differs between a real account and nobody, the page is telling strangers who your users are. It is the same check as “wrong password” against “unknown email” on [the login page](https://everyrole.dev/blog/login-page-test-cases).

## 2. The email

- **It arrives**, in a time you chose and wrote down.
- **Its link points at the live site.** Read the link’s address. A reset link to a staging host is a leftover we look for, and it is found only by opening a real email.
- **It contains no password.** Not the old one, not a new one. Only a link.
- **It says what to do if you didn’t ask.** Someone else may have typed your address.

For a test to read that email it needs an inbox of its own. We wrote that up separately in [how to test email verification](https://everyrole.dev/blog/test-email-verification).

## 3. Test cases for reset password: the link

This is the part to spend the time on.

| Case | What to do | What must come out |
| --- | --- | --- |
| The link, once | Open it, set a new password | The password is changed, and the app says so |
| The link, twice | Open the same link again | Refused, in the app’s own words, with a way to ask for a new link |
| Back and send again | After setting the password, press Back and send the form again | Refused. The password is not changed a second time |
| An older link | Ask twice, use the first email’s link | Refused, if you decided only the latest works |
| A changed link | Change the last characters of the link’s address | Refused the same way as a used link. No server error |
| Reset link expiry | Use a link after its lifetime | Refused, with a way to ask again |
| Another account | With two test accounts, open A’s link and change any account id or address in the form or the link to B’s | Only A’s password changes. B’s still works |

**On expiry.** Pick the lifetime, write the number into the test case, and test both sides of it: just before, it works, and just after, it doesn’t. That is [a boundary](https://everyrole.dev/blog/boundary-value-testing) like any other. Waiting an hour in a test is not practical, so ask for one of two things: a setting that shortens the lifetime on staging, or a way to make a link that is already old. If neither exists, keep one link overnight and try it in the morning. A slow test is still a test.

**On the link’s address.** The secret is in the address, so the page it opens must not hand that address to anyone else. If the reset page loads scripts or images from other sites (analytics, a chat widget), open the browser’s network panel and check that none of those requests carries the full link, in a Referer header or anywhere else. A `Referrer-Policy` of `no-referrer` on that page closes the usual leak.

**On reset token reuse.** “Twice” is ordinary use. Some mail programs and link scanners open links before the person does, and people double-click. So the second opening must not be a crash, and it must not let anyone set a password again.

## 4. After the new password

The link has done its job. Four things should now be true, and the first is the one a password reset exists for.

1. **The old password no longer works.** Log out, try the old one, expect the login’s usual refusal. It is easy to forget, because nothing on screen reminds you to try it.
2. **The new password works**, on the login page, typed by hand.
3. **Other sessions are signed out**, if that is what you decided. Stay logged in on a second browser, reset the password in the first, then reload the second. Someone resets a password because they fear another person has it. That other person should not stay logged in.
4. **The account’s owner is told.** A short “your password was changed” email, for the case where the owner didn’t do it.

And the new password itself follows the same rules as at sign-up: the minimum length, the confirmation that must match, and whether the old password may be chosen again. Whatever [the sign-up form](https://everyrole.dev/blog/registration-page-test-cases) refuses, this form must refuse too. The two are written at different times, and nothing makes them agree.

## The forgot password test cases to run first

If you are short of time, run these four by hand, in this order:

1. Ask for a link with an address that has no account. Read the answer.
2. Ask with the test account, open the link, set a new password.
3. Open the same link again.
4. Log in with the old password.

Three of the four have a wrong answer that is a real security problem: telling strangers who has an account, a link that works for ever, or an old password that still opens the door.

## Where EveryRole stands on this

We’ll be plain about what it covers. The page that asks for the link is a form, so it gets a form’s main cases: good input, empty, wrong format, and wrong then right once the form has refused something.

The link’s life is part of a longer test: EveryRole signs up a brand-new account through an inbox of its own and walks it through log in, log out and a password reset. That test is off until you turn it on, because it makes a real account each time. With it on, one stop asks for the reset email, opens its link, sets a new password and logs in with it. An extra case, off until you choose it, then tries the old password and opens the same link a second time.

It doesn’t test an older link, the link’s lifetime, another account’s link, a limit on requests, other sessions, or whether the page answers the same for an address with no account. Each of those needs a decision from you first (the lifetime, which link wins, what happens to other sessions), so today they are yours to run by hand or to script.

## Try it on your own app

EveryRole tests your app’s real user journeys for each kind of user, from the live site, and runs them after every deploy. Paste your app’s address to see what it finds.

[Start with your app](https://everyrole.dev/signup) [How it works](https://everyrole.dev/docs#start)

## Keep reading

Sign-up, login and passwords

### [How to test email verification, from inbox to app](https://everyrole.dev/blog/test-email-verification)

How to test email verification end to end. The test has to read the real email, so give it an inbox of its own, a new address per run, and five things to check.

Nov 22, 2026  6 min read

Sign-up, login and passwords

### [Test cases for a login page, beyond the password](https://everyrole.dev/blog/login-page-test-cases)

Test cases for a login page beyond right and wrong passwords: right after wrong, where you land, already signed in, Back after log out, with real answers.

Nov 22, 2026  6 min read

Sign-up, login and passwords

### [User sign-up test cases, from the form to first login](https://everyrole.dev/blog/registration-page-test-cases)

User sign-up test cases for a registration page: the form, the confirmation email, the link in it and the first login, with what each step must answer.

Nov 22, 2026  7 min read
