Skip to main content

OAuth2 User Frontend - Test Cases

User frontend path: / | Framework: Vue 3 + TailwindCSS | Playwright E2E

Module 1: Authentication

1.1 Login Page (/login)

IDTest CaseStepsExpected ResultPriority
U-LOGIN-001Valid credentialsEnter valid username/password, click Sign InRedirect to Dashboard (/)P0
U-LOGIN-002Empty usernameSubmit with empty usernameHTML5 required validation prevents submitP1
U-LOGIN-003Empty passwordSubmit with empty passwordHTML5 required validation prevents submitP1
U-LOGIN-004Wrong passwordEnter valid user + wrong passwordError alert displayedP0
U-LOGIN-005Non-existent userEnter unregistered usernameError message shownP0
U-LOGIN-006SQL injectionEnter ' OR 1=1 -- as usernameError message, no unauthorized accessP0
U-LOGIN-007XSS in usernameEnter <script>alert('xss')</script>Rendered as text, no script executionP0
U-LOGIN-008Loading stateSubmit valid credentialsButton shows loading spinner, disabledP2
U-LOGIN-009Redirect after loginLogin with ?redirect=/profile in URLRedirect to /profile after loginP0
U-LOGIN-010Already authenticatedNavigate to /login while logged inRedirect to DashboardP0
U-LOGIN-011GitHub social loginClick "Sign in with GitHub"Redirected to GitHub OAuth pageP1
U-LOGIN-012GitHub client_id not configuredWhen VITE_GITHUB_CLIENT_ID is emptyGitHub button still visible, link has no client_idP2
U-LOGIN-013Link to registerClick "create a new account" linkNavigate to /registerP1
U-LOGIN-014Link to forgot passwordClick "Forgot password?"Navigate to /forgot-passwordP1
U-LOGIN-015Browser autofillUse browser autofill for credentialsForm submits correctly with autofilled valuesP2

1.2 MFA Challenge

IDTest CaseStepsExpected ResultPriority
U-MFA-001MFA required flowLogin with MFA-enabled userMFA challenge form shown (6-digit input)P0
U-MFA-002Valid MFA codeEnter correct 6-digit TOTP codeLogin succeeds, redirect to DashboardP0
U-MFA-003Invalid MFA codeEnter wrong 6-digit codeError message displayedP0
U-MFA-004Less than 6 digitsEnter "1234"Submit button disabled (mfaCode.length !== 6)P1
U-MFA-005More than 6 digitsInput limited to 6 chars (maxlength=6)Cannot enter more than 6 digitsP1
U-MFA-006Non-numeric inputEnter letters in MFA fieldInput limited by inputmode="numeric"P1
U-MFA-007Back to loginClick "Back to login" linkMFA form hidden, login form shownP1
U-MFA-008Loading stateSubmit MFA codeButton shows loading state, disabledP2
U-MFA-009Expired MFA tokenWait for mfa_token to expire, then submit codeError message, may need to re-loginP1

1.3 Registration Page (/register)

IDTest CaseStepsExpected ResultPriority
U-REG-001Valid registrationFill username, email, password (6+ chars), matching confirm, submitSuccess message shown, auto-redirect to login after 2sP0
U-REG-002Password too shortEnter 5-char passwordError: "Password must be at least 6 characters"P0
U-REG-003Passwords don't matchEnter different passwordsError: "Passwords do not match"P0
U-REG-004Duplicate usernameRegister with existing usernameError message from APIP0
U-REG-005Duplicate emailRegister with existing emailError message from APIP0
U-REG-006Empty usernameSubmit with empty usernameForm submits successfully (username is optional)P1
U-REG-007Empty emailSubmit with empty emailHTML5 required validationP1
U-REG-008Invalid email formatEnter "not-an-email"HTML5 email validation prevents submitP1
U-REG-009SQL injection in usernameEnter '; DROP TABLE users;--Error or registration fails safelyP0
U-REG-010XSS in usernameEnter <script>alert(1)</script>Rendered as textP0
U-REG-011Very long usernameEnter username > 255 charsAPI validation error or truncation handledP2
U-REG-012Loading stateSubmit valid formButton shows "Creating...", disabledP2
U-REG-013Success redirect timingAfter successful registrationSuccess message visible, then redirect after 2sP2
U-REG-014Link to loginClick "Sign in" linkNavigate to /loginP1
U-REG-015Already authenticatedNavigate to /register while logged inRedirect to DashboardP1

1.4 Forgot Password (/forgot-password)

IDTest CaseStepsExpected ResultPriority
U-FP-001Valid emailEnter registered email, submitSuccess message shown (anti-enumeration: always success)P0
U-FP-002Unregistered emailEnter non-existent emailStill shows success message (anti-enumeration)P0
U-FP-003Invalid email formatEnter "not-email"HTML5 email validationP1
U-FP-004Empty emailSubmit with empty emailHTML5 required validationP1
U-FP-005Loading stateSubmit formButton shows "Sending...", disabledP2
U-FP-006Back to login linkClick "Back to Login"Navigate to /loginP1
U-FP-007API error handlingSimulate network error during submitStill shows success (anti-enumeration by design)P1

1.5 Reset Password (/reset-password)

IDTest CaseStepsExpected ResultPriority
U-RP-001Valid reset tokenNavigate with valid token, enter new passwordPassword reset succeeds, redirect to loginP0
U-RP-002Expired reset tokenNavigate with expired tokenError: token expired or invalidP0
U-RP-003Invalid reset tokenNavigate with random tokenError messageP0
U-RP-004No token in URLNavigate to /reset-password without tokenError or redirect to forgot-passwordP1

1.6 Email Verification (/verify-email)

IDTest CaseStepsExpected ResultPriority
U-VE-001Valid verification tokenNavigate with valid tokenEmail verified, success messageP0
U-VE-002Expired tokenNavigate with expired tokenError message, option to resendP1
U-VE-003Already verifiedVerify already-verified emailMessage: already verifiedP1
U-VE-004Invalid tokenNavigate with random tokenError messageP0

Module 2: OAuth2 Flows

2.1 Authorization Callback (/callback)

IDTest CaseStepsExpected ResultPriority
U-CB-001Valid authorization codeNavigate with ?code=xxxCode exchanged, redirect to DashboardP0
U-CB-002Error from providerNavigate with ?error=access_deniedError displayed: "access_denied" or descriptionP0
U-CB-003No code parameterNavigate to /callback without paramsError: "No authorization code received"P0
U-CB-004Loading spinnerObserve during code exchangeSpinner shown while "Completing sign in..."P2
U-CB-005Invalid authorization codeNavigate with ?code=invalid_codeError message from token exchange failureP0
U-CB-006Expired authorization codeUse code after 10-minute expiryError messageP1
U-CB-007Back to login linkClick "Back to Login"Navigate to /loginP1

2.2 GitHub Callback (/callback/github)

IDTest CaseStepsExpected ResultPriority
U-GH-001Valid GitHub codeGitHub redirects with valid codeUser authenticated via GitHub, redirected to DashboardP1
U-GH-002GitHub auth deniedUser denies GitHub authorizationError message displayedP1
U-GH-003New GitHub userFirst-time GitHub loginAccount auto-created with GitHub profile infoP1
IDTest CaseStepsExpected ResultPriority
U-CON-001Approve consentReview requested scopes, click ApproveAuthorization code returned to clientP0
U-CON-002Deny consentClick DenyError returned to client, user redirectedP0
U-CON-003Scope displayView consent pageAll requested scopes listed with descriptionsP0
U-CON-004No scopes requestedConsent page with no scopesMinimal consent or handled gracefullyP2

2.4 Device Verification (/device/verify)

IDTest CaseStepsExpected ResultPriority
U-DV-001Valid device codeEnter valid device code, verifyDevice authorizedP0
U-DV-002Invalid device codeEnter wrong codeError: invalid or expired codeP0
U-DV-003Expired device codeEnter expired codeError messageP1
U-DV-004Empty device codeSubmit without entering codeValidation errorP1

Module 3: Account Pages (Protected)

3.1 Dashboard (/)

IDTest CaseStepsExpected ResultPriority
U-DASH-001Dashboard loadsLogin, view DashboardWelcome message with username, Account ID, Email, Roles displayedP0
U-DASH-002No rolesUser with no assigned roles"None" displayed in roles sectionP1
U-DASH-003Multiple rolesUser with admin + user rolesBoth role badges displayedP1
U-DASH-004Quick linksClick Edit Profile / Security / Authorized AppsNavigates to correct pageP0
U-DASH-005Unauthenticated accessNavigate to / without authRedirect to /login?redirect=/P0
U-DASH-006Session restoreReopen browser to / with valid sessionSession restored via auth.restoreSession(), Dashboard shownP0
U-DASH-007Session restore failureReopen browser with expired sessionRedirect to login with redirect paramP1

3.2 Profile Page (/profile)

IDTest CaseStepsExpected ResultPriority
U-PROF-001Profile loadsNavigate to ProfileUsername, Account ID, Email, Verification status, Roles shownP0
U-PROF-002Email verifiedUser with verified emailGreen "Verified" badgeP1
U-PROF-003Email unverifiedUser with unverified emailYellow "Unverified" badge, "Resend verification" link shownP0
U-PROF-004Resend verificationClick "Resend verification email"Success: "Verification email sent!", disappears after 3sP0
U-PROF-005Resend verification failureSimulate API failureError message displayedP1
U-PROF-006No emailUser without email"N/A" displayed for email, no resend linkP2
U-PROF-007API failureSimulate GET /api/me failureError: "Failed to load profile"P0
U-PROF-008Loading stateObserve during page load"Loading..." placeholder shownP2

3.3 Security Page (/security)

IDTest CaseStepsExpected ResultPriority
U-SEC-001Page loadsNavigate to SecurityPassword change form, MFA section, WebAuthn section displayedP0
U-SEC-002Change password - validEnter old + new password (6+ chars, matching), submitSuccess message, fields clearedP0
U-SEC-003Change password - mismatchNew password != confirmError: "Passwords do not match"P0
U-SEC-004Change password - too shortNew password < 6 charsError: "Password must be at least 6 characters"P0
U-SEC-005Change password - wrong oldEnter incorrect old passwordError message from APIP0
U-SEC-006Change password - empty fieldsSubmit with empty old passwordForm validation or API errorP1
U-SEC-007MFA setupClick "Setup MFA"QR code and secret key displayedP0
U-SEC-008MFA verify - valid codeEnter correct TOTP code after setupSuccess: "MFA enabled successfully!", MFA now activeP0
U-SEC-009MFA verify - invalid codeEnter wrong codeError messageP0
U-SEC-010MFA disable - valid passwordEnter password, click Disable MFASuccess: "MFA disabled"P0
U-SEC-011MFA disable - empty passwordClick Disable without entering passwordError: "Password required to disable MFA"P1
U-SEC-012MFA disable - wrong passwordEnter wrong passwordError message from APIP0
U-SEC-013WebAuthn registerClick "Register Passkey"Browser WebAuthn dialog shownP1
U-SEC-014WebAuthn register cancelCancel browser dialogError: "Passkey registration was cancelled or timed out"P1
U-SEC-015WebAuthn not supportedAccess from unsupported browserWebAuthn section hidden or "not supported" messageP1
U-SEC-016Delete account - correct usernameEnter matching username, click DeleteAccount deleted, redirected to loginP0
U-SEC-017Delete account - wrong usernameEnter non-matching usernameError: "Username does not match"P0
U-SEC-018Delete account - empty usernameClick Delete without usernameValidation prevents submissionP1
U-SEC-019Loading statesSubmit any formButtons show loading state, disabled during requestP2

3.4 Authorized Apps (/authorized-apps)

IDTest CaseStepsExpected ResultPriority
U-APP-001List authorized appsNavigate to Authorized AppsEach app shows name, client_id, scopes, Revoke buttonP0
U-APP-002Empty listUser has no authorized apps"No authorized applications" empty stateP1
U-APP-003Revoke appClick Revoke, confirm dialogApp removed from list, success messageP0
U-APP-004Revoke cancelClick Revoke, cancel confirmApp remains in listP1
U-APP-005Revoke failureSimulate API failure on revokeError message displayedP0
U-APP-006App without nameApp has client_id but no nameclient_id displayed as fallback nameP1
U-APP-007Success message auto-dismissAfter successful revokeSuccess message disappears after 3sP2
U-APP-008Loading stateDuring initial load"Loading..." placeholder shownP2

Module 4: Navigation & Layout

IDTest CaseStepsExpected ResultPriority
U-NAV-001Top navigation linksClick Overview/Profile/Security/Authorized AppsCorrect page loads, active link highlightedP0
U-NAV-002Logo linkClick logoNavigate to DashboardP1
U-NAV-003User dropdownClick user avatarDropdown with Profile, Security, Sign OutP0
U-NAV-004Dropdown navigationClick Profile in dropdownNavigate to /profile, dropdown closesP1
U-NAV-005Click outside dropdownOpen dropdown, click outsideDropdown closesP1
U-NAV-006Logout from dropdownClick "Sign Out"Session cleared, redirect to loginP0
U-NAV-007Sticky headerScroll page contentHeader remains visible at topP2
U-NAV-008Responsive navResize to mobile widthNav collapses to hamburger or minimal layoutP1
U-NAV-009Active nav stateNavigate to /security"Security" nav link highlighted with indigo backgroundP1

Module 5: Cross-Cutting Concerns

5.1 Error Handling

IDTest CaseStepsExpected ResultPriority
U-ERR-001Network errorDisable network during API callError message displayed, no crashP0
U-ERR-002401 UnauthorizedLet session expire, make API callRedirect to login pageP0
U-ERR-003500 Server errorTrigger server errorError message, no crashP0
U-ERR-004Success message auto-dismissPerform successful actionSuccess message disappears after 3-4 secondsP2
U-ERR-005Error normalizationReceive non-standard API errorError normalized via errorAdapter, user-friendly messageP1

5.2 Security

IDTest CaseStepsExpected ResultPriority
U-SEC-001Route guard - protected pagesNavigate to /profile without authRedirect to /login?redirect=/profileP0
U-SEC-002Route guard - guest pagesNavigate to /login while authenticatedRedirect to DashboardP0
U-SEC-003Token not in URLAfter loginAccess token not visible in URLP0
U-SEC-004Password field maskingView all password fieldsType="password", characters maskedP1
U-SEC-005Anti-enumeration (forgot password)Submit unregistered emailSame success message as registered emailP0
U-SEC-006CSRF on password changeChange password requestProper auth headers includedP0
U-SEC-007localStorage cleared on logoutLogout, check localStorageAuth tokens removedP0
U-SEC-008localStorage cleared on account deleteDelete accountlocalStorage.clear() calledP0

5.3 Session Management

IDTest CaseStepsExpected ResultPriority
U-SESS-001Session restore on page reloadRefresh page while logged inSession restored, no redirect to loginP0
U-SESS-002Session expire during useWait for token expiry, make API callRedirect to loginP0
U-SESS-003Multiple tabsOpen app in two tabs, logout in oneOther tab redirects to login on next navigationP1
U-SESS-004Token refreshAccess token expires, refresh token validNew access token obtained seamlesslyP1

5.4 Performance

IDTest CaseStepsExpected ResultPriority
U-PERF-001Lazy-loaded routesCheck network tab during navigationOnly required chunks loaded (code splitting)P2
U-PERF-002Large authorized apps listUser with 50+ authorized appsPage renders without lagP1
U-PERF-003WebAuthn credential listUser with many registered passkeysCredentials listed efficientlyP2

5.5 Accessibility

IDTest CaseStepsExpected ResultPriority
U-A11Y-001Form labelsInspect all form inputsAll inputs have associated labelsP1
U-A11Y-002Required field indicatorsView registration formRequired fields marked (asterisk or "required" attribute)P1
U-A11Y-003Keyboard navigationTab through login formAll interactive elements reachable, focus visibleP1
U-A11Y-004Submit on EnterPress Enter in password fieldForm submitsP1
U-A11Y-005Error announcementTrigger form errorError message readable by screen readerP2
U-A11Y-006Autocomplete attributesInspect login formautocomplete="username", "current-password" set correctlyP2

Module 6: Edge Cases & Stress Scenarios

IDTest CaseStepsExpected ResultPriority
U-EDGE-001Unicode usernameRegister with 用户名 as usernameHandled correctly or validation errorP1
U-EDGE-002Email with + addressingRegister with [email protected]Accepted and handled correctlyP1
U-EDGE-003Very long passwordEnter 1000-char passwordAccepted or validation error with messageP2
U-EDGE-004Special characters in passwordEnter P@$$w0rd!#%^&*()Password acceptedP1
U-EDGE-005Browser back after logoutLogout, press browser BackRedirect to login (no cached authenticated page)P1
U-EDGE-006Direct URL to OAuth callbackNavigate to /callback directlyError: "No authorization code received"P1
U-EDGE-007Double-click submitRapidly double-click Sign InOnly one request sent (button disabled)P2
U-EDGE-008Slow networkLogin on slow 3G connectionLoading state shown, eventually completes or times outP2
U-EDGE-009WebAuthn in HTTP contextAccess via HTTP (not HTTPS)WebAuthn gracefully unavailableP1
U-EDGE-010Multiple MFA setup attemptsClick Setup MFA multiple timesOnly one setup flow active at a timeP2