Test Case Suite: Web Application Authentication
User Authentication & Login
Test Case Overview
| Test Case ID | Title | Complexity | Automation | Status |
|---|---|---|---|---|
| TC-AUTH-001 | Valid login with email/password | Low | ✅ | ✓ Pass |
| TC-AUTH-002 | Invalid password → error message | Low | ✅ | ✓ Pass |
| TC-AUTH-003 | Non-existent user → graceful error | Low | ✅ | ✓ Pass |
| TC-AUTH-004 | Password field is masked | Low | ❌ | ✓ Pass |
| TC-AUTH-005 | Remember me → persistent login | Medium | ❌ | ✓ Pass |
| TC-AUTH-006 | Session timeout after inactivity | Medium | ❌ | ⚠ Flaky |
| TC-AUTH-007 | Concurrent login — multiple devices | Medium | ❌ | ✓ Pass |
| TC-AUTH-008 | Account lockout after failed attempts | Medium | ✅ | ✓ Pass |
| TC-AUTH-009 | Forgot password flow | Medium | ✅ | ✓ Pass |
| TC-AUTH-010 | Social login: Google OAuth | High | ❌ | ✓ Pass |
| TC-AUTH-011 | SAML SSO (enterprise) | High | ❌ | ✓ Pass |
| TC-AUTH-012 | MFA — email code validation | High | ❌ | ⚠ Flaky |
| TC-AUTH-013 | Token refresh on API requests | High | ✅ | ✓ Pass |
| TC-AUTH-014 | CSRF protection — form token validation | Medium | ✅ | ✓ Pass |
| TC-AUTH-015 | Logout — token revocation | Low | ✅ | ✓ Pass |
Detailed Test Cases
TC-AUTH-001: Valid Login with Email/Password
Objective:
Verify a user with valid credentials can successfully log in and access the application.
Preconditions:
- User exists in system (email: test.user@example.com, password: ValidPass123!)
- User is not locked out
- Browser cookies/cache are cleared
- User is on the login page
Test Steps:
| # | Step | Expected Result | Status |
|---|---|---|---|
| 1 | Enter email address: test.user@example.com in Email field |
Field accepts input; no error shown | ✓ |
| 2 | Enter password: ValidPass123! in Password field |
Field accepts input; dots/asterisks mask password | ✓ |
| 3 | Click "Sign In" button | Button becomes disabled; loading spinner appears | ✓ |
| 4 | Wait for API response (max 5 seconds) | No error message; page redirects to Dashboard | ✓ |
| 5 | Verify dashboard loads with user content | User name displays in top-right; projects list shows | ✓ |
| 6 | Verify session cookie created | session_id cookie present in browser; HttpOnly flag set |
✓ |
| 7 | Refresh page | Dashboard persists; no login required | ✓ |
Expected Result:
✅ User successfully logged in; dashboard accessible; session established.
Actual Result:
✅ Passed
Notes:
- Browser/OS: Chrome 123 / macOS Ventura
- Automation Script:
tests/auth/login_valid_credentials.spec.js - Test runs in CI/CD pipeline; execution time ~2 seconds.
TC-AUTH-002: Invalid Password → Error Message
Objective:
Verify the system displays an appropriate error when an incorrect password is provided.
Test Steps:
| # | Step | Expected Result | Status |
|---|---|---|---|
| 1 | Enter valid email: test.user@example.com |
Email field accepts input | ✓ |
| 2 | Enter incorrect password: WrongPass123! |
Password field accepts input; masked | ✓ |
| 3 | Click "Sign In" button | Loading spinner appears | ✓ |
| 4 | Wait for response | Error message appears: "Invalid email or password" | ✓ |
| 5 | Verify error styling | Error text in red; icon indicating error shown | ✓ |
| 6 | Verify user not logged in | Dashboard not accessible; login form still visible | ✓ |
| 7 | Attempt login again with correct password | Subsequent login succeeds (no lockout yet) | ✓ |
Expected Result:
✅ Error message displayed; user remains on login page; no session created.
Actual Result:
✅ Passed
Notes:
- Browser/OS: Chrome 123 / macOS Ventura
- Generic error message used to prevent user enumeration (security best practice).