Source: https://everyrole.dev/blog/login-page-test-cases

# Test cases for a login page, beyond the password

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  by the EveryRole team

The test cases for a login page that every list has are the right password and the wrong one. The ones that find bugs come after: logging in right after a wrong try, where the person lands, what a signed-in person gets at the login page, and what Back shows after logging out. We ran the whole list on our practice app. The password check was fine. Four other things were not.

Here is the list, then what the app really answered.

## A login testing checklist

| Case | What to do | What must come out |
| --- | --- | --- |
| Good login | The test account’s email and password | Signed in, on the page that was asked for |
| Empty | Press “Log in” with nothing typed | The form stays, and says which field is missing |
| Wrong format | `not an email`as the email | A message at the email field |
| Wrong password | The right email, a wrong password | A refusal that doesn’t say which of the two was wrong. The form is still there, the email kept |
| Unknown email | An address with no account | Exactly the same answer as the wrong password |
| Right after wrong | A wrong password, then the right one | Signed in, on the page that was asked for |
| Other case | `Editor@Example.com`for `editor@example.com` | Your decision. Usually: the same person |
| A pasted space | The email with a space after it | Signed in, or a message that says why not |
| Already signed in | Open the login page while signed in | Sent on into the app |
| Back after log out | Log out, press Back | The login page. Not the private page from the browser’s memory |
| A changed destination | Change the address the login returns to | Stays on your site |

Eleven rows. The first five are the list everyone has. The rest is this post.

## Negative test cases for a login page: the refusal

Start with the wrong password, because it sets up the rest.

![The practice app's login page after a wrong password: the heading "Log in", a red message "Wrong email or password", and a link "Try again". There is no form on the page.](https://everyrole.dev/s/blog/login-page-test-cases/wrong-password.webp)

The practice app’s answer to a wrong password. The message is right. The page is a dead end.

Two things to read in that answer.

**The message.** “Wrong email or password” doesn’t say which. That is right: a login page that says “no account with this email” tells a stranger which addresses are registered. We compared the app’s answer to a wrong password with its answer to an unknown email, and the two pages are identical, status and all. Write that comparison into your case. The words can match while the status code or the response time gives it away.

**The page.** The form is gone. The email is gone. The person has to press “Try again” and type everything a second time, for one mistyped character in a password they couldn’t see. It is the same dead end we found in [the empty form post](https://everyrole.dev/blog/empty-form-test), and it is the thing to look for on your own login page: after a refusal, is the form still there, with the email in it?

## Right after wrong, and where you land

This is the case that separates a login test from a password test.

We started signed out and asked for the new item form. The app sent us to log in and remembered where we were going. Then we typed a wrong password, and then the right one.

One wrong password, and the app forgets where we were going.

Signed in, and on the list. The form we had asked for was forgotten. Logging in on the first try lands on the form, as it should. So the destination is kept through a good login and lost through one wrong password: the “Try again” link drops it.

No error anywhere. The login “works”. A person who followed a link from an email, mistyped once, and landed on a page that has nothing to do with the link will just think the link was wrong. [Wrong then right](https://everyrole.dev/blog/wrong-then-right-test) is the least tested state of any form, and on a login form it has this extra way to fail.

## Small differences in the email

Two rows that depend on a decision, so make the decision.

Our practice app refuses `Editor@Example.com` when the account is `editor@example.com`: “Wrong email or password”. A phone that capitalises the first letter is enough. A pasted space is kinder: the browser’s email field drops it before sending, so it logs in. Sent past the browser, the server refuses it, and a plain text email field would send the space on.

Whether case should matter is yours to choose. Whatever you choose, the sign-up form and the login form have to agree, or people register one way and can’t log in the other. That pair is a case in [the sign-up list](https://everyrole.dev/blog/registration-page-test-cases) too.

## Already signed in, and Back after log out

**Already signed in.** Open the login page in a tab where you are signed in. Our practice app shows the form again, as if nobody were there. In an app where logging in a second time makes a second session, or where the form logs you in as someone else while the other tab still shows the first account, it is the start of a confusing bug report.

**Back after log out.** Log out on a private page, then press the browser’s Back button. You must not see the private page again. Browsers keep pages in memory, and a page served without the right cache headers comes back with all its data, on a shared computer, for the next person. Our practice app has no log out, so we can’t show this one on it. It does send `Cache-Control: no-store` on every page, which is the header this case checks for.

## A changed destination

The login page carried the address to return to in its own address: `/login?next=/items/new`. Anything in an address can be changed by whoever sends the link.

We tried two changes. With `next=https://example.com/` the app ignored it and went to the list. Good. With `next=//example.com/` the app sent the browser there, to another site, straight after a successful login. That is an open redirect, and it is the kind a quick check misses, because the first attempt is refused.

We are leaving the finding in this post because it is the honest result of running the last row.

## What we didn’t cover

Many wrong passwords in a row. Decide what should happen (a pause, a lock, an email) and try it. Our practice app has no limit at all, which is a finding of its own. And second factors, which deserve their own list. The reset link has one already: [forgot password test cases](https://everyrole.dev/blog/forgot-password-test-cases).

## How EveryRole runs a login form

To EveryRole a login page is a form stop. Its main cases there are Good input, Wrong format (the email field states a format), Empty, and Wrong then right once the form has refused something. You approve each first result, and every later run compares with it, so a refusal message that changes, or a good login that starts landing somewhere else, comes back as “Result changed”.

It also signs in as each kind of user you gave a test login for at the start of their journeys, on every run, so a login that stops working shows up at the start of a run.

The four findings above are still ours, though. On this form the browser stops the empty and the wrong-format case before the server sees them, and no case sends a wrong password, so the dead-end refusal page is never reached. Today its Wrong then right loads the form again before the good input, so it doesn’t follow “Try again” and wouldn’t see the lost destination. And it doesn’t edit addresses, so the changed destination is a test for you.

## 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

### [Password reset test cases: the email, the link, the reuse](https://everyrole.dev/blog/forgot-password-test-cases)

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  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

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
