Login Page Test Cases: A 45-Point Checklist
The login page is the most tested page in software, and yet it still ships with bugs: a disabled button that never enables, an error message that reveals which emails exist, a session that survives logout. Use this checklist as a starting point and adapt it to your app.
Priority key: P1 = test on every release · P2 = test when the area changes · P3 = test periodically
Functional
| # | Test case | Priority |
|---|---|---|
| 1 | Valid email and password log the user in and land on the expected page | P1 |
| 2 | Wrong password shows an error and the user stays on the login page | P1 |
| 3 | Unregistered email shows the same error as a wrong password | P1 |
| 4 | Empty email and empty password both show a required-field message | P1 |
| 5 | Pressing Enter in the password field submits the form | P2 |
| 6 | Email login is not case-sensitive (User@Example.com works) |
P2 |
| 7 | Password is case-sensitive | P1 |
| 8 | Leading or trailing spaces in the email are trimmed, or rejected clearly | P2 |
| 9 | “Remember me” keeps the user logged in after the browser restarts, and leaving it unticked does not | P2 |
| 10 | “Forgot password” link opens the reset flow | P1 |
| 11 | “Sign up” link opens registration | P3 |
| 12 | After login, the user is returned to the page they originally asked for (deep link) | P2 |
| 13 | Logout ends the session, and the back button doesn’t show protected pages | P1 |
Input validation
| # | Test case | Priority |
|---|---|---|
| 14 | Invalid email formats are rejected: user, user@, @example.com, user@example |
P2 |
| 15 | Valid but unusual emails are accepted: first.last+qa@sub.example.co.uk |
P2 |
| 16 | Minimum and maximum lengths: test the boundary values for email and password length | P2 |
| 17 | Very long input (1,000+ characters) doesn’t break the layout or cause a server error | P3 |
| 18 | Unicode and accented characters in the password work: Pässwörd! |
P3 |
| 19 | Pasting into the password field works, unless pasting is deliberately blocked | P3 |
| 20 | Error messages are clear, sit next to the right field, and clear once the input is fixed | P2 |
Security
| # | Test case | Priority |
|---|---|---|
| 21 | Password is masked by default, and the show/hide toggle works | P1 |
| 22 | The page is served only over HTTPS, and HTTP redirects to HTTPS | P1 |
| 23 | Credentials are sent in the request body, never in the URL or query string | P1 |
| 24 | Repeated failed attempts trigger a lockout, a CAPTCHA or rate limiting | P1 |
| 25 | Error messages don’t reveal whether an account exists | P1 |
| 26 | SQL injection inputs such as ' OR '1'='1 are rejected safely, with no server error |
P1 |
| 27 | Script inputs such as <script>alert(1)</script> are not executed when shown back |
P2 |
| 28 | The password is not stored in plain text in local storage, cookies or logs | P1 |
| 29 | Session cookies have the Secure, HttpOnly and SameSite flags |
P2 |
| 30 | A new session ID is issued after login (prevents session fixation) | P2 |
| 31 | The password field has autocomplete="current-password" so password managers work |
P3 |
Session and tokens
| # | Test case | Priority |
|---|---|---|
| 32 | An expired session or token redirects to login with a clear message | P1 |
| 33 | Logging out in one tab logs out the other tabs too, or they redirect on their next action | P2 |
| 34 | An API call with no token or an invalid token returns 401, and the UI handles it | P1 |
| 35 | Changing the password ends the user’s other sessions (if that is the requirement) | P2 |
| 36 | An already logged-in user who visits /login is redirected, not shown the form |
P3 |
Usability and accessibility
| # | Test case | Priority |
|---|---|---|
| 37 | Every field has a visible label, not only a placeholder | P2 |
| 38 | Tab order is logical: email → password → show password → remember me → submit | P2 |
| 39 | Everything works with the keyboard alone | P2 |
| 40 | Screen readers announce error messages (for example through aria-live or aria-describedby) |
P2 |
| 41 | Colour contrast meets WCAG AA, and errors don’t rely on red alone | P3 |
| 42 | The submit button shows a loading state, and a double click doesn’t send two requests | P2 |
Compatibility
| # | Test case | Priority |
|---|---|---|
| 43 | Works in current Chrome, Firefox, Safari and Edge | P1 |
| 44 | Works on mobile at 375px width, and the keyboard doesn’t hide the submit button | P1 |
| 45 | Browser autofill and password managers fill the fields, and the button enables afterwards | P2 |
How to use this checklist
- Remove what doesn’t apply. No “Remember me”? Drop test 9.
- Add your own rules. SSO buttons, two-factor codes and “magic link” emails each need their own section.
- Automate the P1 functional and session cases. They make a fast smoke suite that runs on every deploy. See how I structure a Playwright framework for that.
- Log what you find clearly. Use the bug report generator so every issue has steps, expected and actual results.
For test accounts, use generated data with example.com emails from the test data generator, never real customer accounts.
FAQ
How many test cases does a login page need?
A typical email-and-password login needs about 30 to 50 checks once you include validation, security, session and accessibility. Prioritise them. The first 10 to 12 cover most of the real risk and make a good smoke suite.
Which login tests should be automated?
Valid login, invalid password, empty fields, logout, and session expiry redirect are good automation candidates because they run on every release. Most security and usability checks are better done by hand, or with dedicated tools.
Should the error say whether the email or the password was wrong?
No. A message such as "Invalid email or password" avoids telling an attacker which emails are registered (user enumeration). Check that the message is the same in both cases.