Storefront Login Test Plan

Phone + OTP authentication flow for customer storefront

Version: 1.0
Last Updated: December 10, 2025
Total Test Cases: 12

Overview

The storefront login uses a phone number + OTP (One-Time Password) authentication flow. Users enter their 10-digit Indian mobile number, receive an OTP via SMS, and verify it to log in. New users are prompted to complete their profile after verification.

Authentication Flow

Enter Phone
Send OTP
Enter OTP
Verify
Profile*
Logged In

* Profile completion only shown for new users

UI Reference

Step 1: Phone Number Entry Screen

Phone Entry UI
Sign in to your account
Enter your phone number to receive an OTP
Phone Number
+91
Enter 10-digit number
Send OTP

Step 2: OTP Verification Screen

OTP Entry UI
Enter verification code
We sent a 6-digit code to +91 9876543210
Enter OTP
1
2
3
4
5
6
Verify OTP

Test Data

Valid Test Phone Numbers

Phone Number Type Notes
9876543210 Existing User Use for returning user tests
9123456789 New User Will trigger profile completion modal
9000000001 Test OTP Dev environment: OTP is always 123456
Note: In development/staging environments, the OTP is typically 123456 for all test numbers. In production, real SMS OTPs are sent.

Test Cases: Phone Number Entry

TC-SF-LOGIN-001 Successful OTP Request with Valid Phone
High

Objective: Verify that users can successfully request an OTP with a valid 10-digit phone number.

  1. Navigate to the storefront login page (/login)
    Login page loads with phone number input field and "Send OTP" button disabled
  2. Enter a valid 10-digit phone number: 9876543210
    "Send OTP" button becomes enabled
  3. Click the "Send OTP" button
    Button shows "Sending..." loading state
  4. Wait for OTP request to complete
    • Screen transitions to OTP entry view
    • Shows message: "We sent a 6-digit code to +91 9876543210"
    • 6 OTP input boxes are displayed
    • 60-second countdown timer starts for resend
    • First OTP input box is auto-focused
TC-SF-LOGIN-002 Phone Number Validation - Less than 10 digits
Medium

Objective: Verify that phone numbers with less than 10 digits are rejected.

  1. Navigate to the login page
    Login page loads
  2. Enter a phone number with only 9 digits: 987654321
    "Send OTP" button remains disabled
  3. Try to submit the form by pressing Enter
    Form does not submit, no API call is made
TC-SF-LOGIN-003 Phone Number Validation - Non-numeric characters
Medium

Objective: Verify that non-numeric characters are automatically stripped from input.

  1. Navigate to the login page
    Login page loads
  2. Try typing letters: abc
    Input field remains empty - letters are not accepted
  3. Try typing special characters: !@#$%
    Input field remains empty - special characters are not accepted
  4. Try pasting a formatted number: 98765-43210
    Input shows 9876543210 - only digits are kept
TC-SF-LOGIN-004 Phone Number Validation - More than 10 digits
Low

Objective: Verify that input is limited to 10 digits maximum.

  1. Navigate to the login page
    Login page loads
  2. Try typing 12 digits: 123456789012
    Input field only accepts first 10 digits: 1234567890
  3. Try pasting a longer number: 9876543210999
    Input shows only 9876543210 - truncated to 10 digits

Test Cases: OTP Verification

TC-SF-LOGIN-005 Successful Login with Valid OTP (Existing User)
High

Objective: Verify that an existing user can successfully log in with a valid OTP.

Precondition: User has already completed phone entry and is on OTP screen.

  1. Enter the valid 6-digit OTP: 123456 (one digit per box)
    • Each digit auto-advances to next input box
    • "Verify OTP" button becomes enabled after 6th digit
  2. Click "Verify OTP" button
    Button shows "Verifying..." loading state
  3. Wait for verification to complete
    • User is redirected to homepage (/) or previous page
    • User's name/avatar appears in header (logged in state)
    • Auth token is stored in localStorage/cookie
TC-SF-LOGIN-006 Successful Login with Valid OTP (New User - Profile Completion)
High

Objective: Verify that new users see profile completion modal after OTP verification.

Precondition: Use a phone number that doesn't exist in the system.

  1. Complete phone entry with new number: 9123456789
    OTP screen is shown
  2. Enter valid OTP: 123456
    OTP is accepted
  3. Click "Verify OTP" button
    • Profile Completion Modal appears
    • Modal contains fields for Name and Email (optional)
    • Background is dimmed/blurred
  4. Fill in profile details and submit
    • Modal closes
    • User is redirected to homepage or previous page
    • User is fully logged in
TC-SF-LOGIN-007 Invalid OTP Error Handling
High

Objective: Verify proper error handling when user enters incorrect OTP.

  1. Complete phone entry and reach OTP screen
    OTP entry screen is displayed
  2. Enter an invalid OTP: 000000
    All 6 digits are entered
  3. Click "Verify OTP" button
    • Error message appears: "Invalid OTP. Please try again."
    • Error is displayed in red error box
    • OTP input boxes are cleared
    • First input box is auto-focused for re-entry
    • User remains on OTP screen
TC-SF-LOGIN-008 OTP Auto-focus and Keyboard Navigation
Medium

Objective: Verify OTP input boxes have proper auto-focus and keyboard navigation.

  1. Reach OTP entry screen
    First OTP input box is automatically focused
  2. Type digit 1
    Digit appears in first box, focus moves to second box
  3. Continue typing 23456
    Each digit fills next box, focus advances automatically
  4. Press Backspace key
    Last digit is cleared, focus moves to previous box
  5. Press Backspace again on empty box
    Focus moves to previous box (if not first box)
TC-SF-LOGIN-009 OTP Paste Functionality
Medium

Objective: Verify users can paste a 6-digit OTP and have it fill all boxes.

  1. Reach OTP entry screen
    OTP input boxes are displayed
  2. Copy 123456 to clipboard
    Text is in clipboard
  3. Click on any OTP input box and paste (Ctrl+V / Cmd+V)
    • All 6 digits are distributed across the 6 input boxes
    • Box 1: 1, Box 2: 2, Box 3: 3, Box 4: 4, Box 5: 5, Box 6: 6
    • "Verify OTP" button becomes enabled

Test Cases: Navigation & Actions

TC-SF-LOGIN-010 Change Phone Number from OTP Screen
Medium

Objective: Verify users can go back to change their phone number.

  1. Complete phone entry and reach OTP screen
    OTP entry screen is displayed
  2. Click "Change phone number" link
    • Returns to phone number entry screen
    • Previous phone number may still be in input (or cleared)
    • OTP inputs are reset
    • No error messages shown
  3. Enter a different phone number and request OTP again
    New OTP request is sent to the new number
TC-SF-LOGIN-011 Resend OTP - Countdown Timer
Medium

Objective: Verify the resend OTP countdown timer works correctly.

  1. Complete phone entry and reach OTP screen
    • OTP entry screen is displayed
    • "Resend in 60s" text is shown (disabled)
  2. Observe countdown timer
    • Timer counts down every second: 60s, 59s, 58s...
    • Resend button/link remains disabled during countdown
  3. Wait for countdown to reach 0
    • Text changes to "Resend OTP" (now clickable)
    • Link color changes to active (primary color)
  4. Click "Resend OTP"
    • New OTP is sent
    • OTP input boxes are cleared
    • First input is focused
    • Countdown resets to 60s
TC-SF-LOGIN-012 Already Authenticated User Redirect
High

Objective: Verify already logged-in users are redirected away from login page.

Precondition: User is already logged in.

  1. While logged in, navigate directly to /login
    • User is automatically redirected to homepage (/)
    • Login page is not displayed
  2. Use browser back button
    Does not return to login page (redirect happens again if attempted)

Pre-Test Checklist

Environment URLs

Environment Storefront URL Login Page
Local http://localhost:4000 http://localhost:4000/login
Development https://dev-store.bizplaza.in https://dev-store.bizplaza.in/login
Staging https://staging-store.bizplaza.in https://staging-store.bizplaza.in/login