In application testing, writing test cases is a critical task for a tester, and it demands experience and a sharp eye on details to develop scenarios. It states that an app tester should concentrate on developing a set of variables or conditions that will assist him in determining whether the software fulfills the needs and functions flawlessly. 

To help you write ecommerce test cases for the login page, in this post, we will put forward a list of use cases that one needs to test a login or signup page. It will help you create more error-free login/Register pages. 

Let’s start!

What Is The Registration or Login Page For eCommerce?

Login Page For eCommerce

An entry page or a web page to a website is a login page that needs user authentication and identification, routinely conducted by entering a combination of username and password. 

Logins may need access to the whole website or a part of it. 

Besides offering site access to the users, logging in also permits the site to track users’ behavior and actions. 

The user may log off a site or web page manually or automatically occur when certain conditions arise, like when the computer turns off, the page closes, etc.

How To Write Test Cases For A Login Page

Now, we will check out the Login Page. 

Testing the Login Page for any app is essential when security is the primary concern. Here we will try covering widely used Login Page scenarios, including functional test cases, non-functional test cases, security test cases, and more. 

Keep reading!

We write test cases for the app’s Login Page while testing, and that page needs to have the below elements:

  • ‘Email/Username/Phone Number‘ Textbox
  • ‘Password‘ Textbox
  • ‘Login‘ Button
  • ‘Keep Me Signed In‘ Checkbox
  • ‘Remember Me‘ Checkbox
  • Link of ‘Sign up/Create an account 
  • Link of ‘Forgot Password’ 
  • CAPTCHA

Next, we will target the below to write test cases for a login page:

  • We need to write test cases on every object in the login form.
  • We should write both functional and non-functional test cases.
  • We need to write both positive and negative test cases. 
  • We should write functional, UI, performance, and compatibility test cases. 

Basic Test Cases for a Registration Page

FeatureDescriptionSteps To ExecuteTest Data / InputExpected Results
User InterfaceCheck all the text boxes, radio buttons, buttons, etc1. Click on Radio buttons, buttons, and dropdownsN/aUI should be perfect
Required fieldsCheck the required fields by not filling any data1. Do not enter any value in the field.
2. Click on the Register button.
N/aIt should show a mandatory symbol (*) on mandatory fields.
Required fieldsCheck user should Register by filling all the required fields1. Enter valid values in the required fields.
2. Click the Register button.
N/a1. Users should be registered successfully.
2. A successful registration message should show.
3. Mail should send to the user
Optional FieldsCheck all the optional fields when do not fill in data1. Do not enter any detail in optional fields
2. Enter valid data in required fields
3. Click on the Signup button
N/a1. It should not ask to fill the optional fields
2. User should be registered successfully
3. A successful registration message should show
4. Mail should send to the user
Optional FieldsCheck all the optional fields when filling data1. Enter valid data in optional fields
2. Enter valid data in required fields
3. Click on the Register button
N/a1. User should be registered successfully
2. A successful registration message should show
3. Mail should send to the user
Email validation• Check the Email text field that has an Email address without @ symbol. • Check the Email text field that has a random string instead of a real email. • Check the Email text field that has @ symbol written in words. • Check the Email text field that has a missing dot in the email address.1. Enter Invalid Emails
2. Click on the Register Button.
1.testAta.com
2.test@acom
3.test@a
4.@a
It should show the validation message for a valid email
Email validationCheck all the valid emails1. Enter valid Emails
2. Click on the Register Button.
[email protected]
[email protected]
It should not show any validation message
Phone Number validationCheck the phone number when passing alphanumeric data1. Enter alphanumeric data in the phone field
2. Click on the Register button
1. data5$7567#7It should show the validation message 8 for Phone Number
Phone Number validationCheck the phone number when not passing the country code1. Enter valid phone number without country code
2. Click on the Register button
1. 950002xxxxIt should show the validation message for country code is required
Phone Number validationCheck the phone number when passing country code1. Enter a valid phone number with country code
2. Click on the Register button
1. +919011xxxxIt should not show any validation message
Password ValidationCheck the password limit when entering a value less than min1. Enter a value that is alphanumeric but less than 8.
2. Click on the Register button
1. PasswordIt should show a validation message
Password ValidationCheck the password limit when entering a value greater than the max1. Enter alphanumeric value but more than 32.
2. Click on the Register button
Any Random string with numbersIt should show a validation message
Password ValidationCheck the password when passing only numbers1. Enter a value in numbers which is between 8-32
2. Click on the Register button
1. 12345678It should show a validation message
Password ValidationCheck the password when passing valid data1. Enter a value in alphanumeric which is in between 8-32
2. Click on the Register button
1. Pass123456It should not show any validation message
Required FieldsVerify if blank spaces are passed in required fields.1. Go to the Site.
2. Passed blank spaces in required fields.
3. Click on the Register button
N/aThose Blank spaces should trim and Validation error message for required fields should visible.
Required FieldsVerify user can verify its Email ID1. Go to the Email.
2. Click on the verification link.
[email protected]The user should get a verification link and be able to verify his/her Email ID.
Phone Number ValidationVerify if the length of the phone number is incorrect i.e. less than 10.1. Enter phone number less than 10 digits.
2. Enter all required fields.
3. Click on Register Button
91901122It should show the validation error message for phone number length.
Phone Number ValidationVerify if the length of the phone number is incorrect i.e. more than 101. Enter phone number less than 10 digits.
2. Enter all required fields.
3. Click on Register Button
91901122445566It should show the validation error message for phone number length.
Password ValidationVerify if the password required rules are not satisfied in the password1. Enter the password which does not satisfy the required rule.
2. Click on the Register button
passwordIt should display an error with required rules for password value (like it should contain a special character, a small case, a number)
Source: LoginRadius

Basic Test Cases for a Login Page

FeatureDescriptionSteps To ExecuteExpected Results
User InterfaceCheck all the text boxes and buttonsCheck Page• UI should be perfect • Text boxes and buttons should be aligned
Required FieldsCheck the required fields by not filling in any data.1. Enter an invalid username
2. Enter the correct password
3. Click on Login Button
User should not log in and should show proper error message
User LoginCheck When passing a correct username and invalid password1. Enter a valid username
2. Enter an incorrect password
3. Click on Login Button
User should not log in and should show proper error message
User InterfaceCheck Keeping Password1. Enter a valid username
2. Do not enter a password
3. Click on Login Button
User should not log in and should show proper error message
User LoginCheck when pass correct email and password1. Enter a valid username
2. Enter a valid password
3. Click on Login Button
User should log in
User LoginCheck if the password is entered in encrypted1. Enter a valid username
2. Enter password
3. Click on Login Button
Password is entered in encrypted form
Signup Option for new usersCheck whether the signup link for the new user is workingClick Signup linkClicking the signup link takes the user to the signup page successfully
Forgot PasswordVerify user should get an error message when he/she enters the not registered email id.1. Click on the Forgot password link.
2. Enter an unregistered email id and click on the send button.
The user should get an error message.
Reset PasswordVerify user should get an error message when he/she enters the previous password.1. Go to the reset password link.
2. Enter the previous password.
3. Click on the Reset Password button.
The user should get an error message.
Reset PasswordVerify the user is able to reset his/her password1. Go to the reset password link.
2. Enter a new password and a confirm password.
3. Click on the Reset Password button.
Users should get the success message and the password should get reset.
Reset PasswordVerify user should get an error message when password and confirm password not matches1. Go to the reset password link.
2. Enter a different new password and a confirm password.
3. Click on the Reset Password button.
Users should get an error message.
Reset PasswordVerify user should be able to log in with a new password.1. Go to the reset password link.
2. Enter a new password and a confirm password.
3. Click on the Reset Password button.
4. Log in by using the new password.
User should able to login
Reset PasswordVerify if the user enters a new password that does not cover the basic requirements of password then the user should be displayed error message1. Go to the reset password link.
2. Enter a new password that does not cover the basic requirements.
3. Click on the Reset Password.
Users should get an error message.
Required FieldsVerify if blank spaces are passed in required fields.1. Go to the Site.
2. Passed blank spaces in required fields.
3. Click on the Login button
Those Blank spaces should trim and the Validation error message for required fields should visible.
Welcome EmailVerify new users should get the welcome email once after the login.1. Go to the Email.
2. Enter Login Email.
Users should get a welcome email on his/her email id.
User LoginVerify when passing incorrect Email and correct password1. Enter incorrect Email.
2. Enter the correct password.
3. Click on the Login Button.
The user should not be able to log in and the error message should be displayed.
User LoginVerify when passing both incorrect Email and password1. Enter incorrect Email.
2. Enter the correct password.
3. Click on the Login Button
The user should not be able to log in and the error message should be displayed.
User Forgot Password.Verify Forgot Password sends a forgot password link.1. Click on the Forgot Password link.
2. Enter Email and click on the send button.
3. Now go to mail7.io and enter the email id.
The user should get the forgot password link on his/her email id.
Source: LoginRadius

Possible List Of Functional & Non-Functional Test Cases For A Login Page

Now, we will check out the test cases for the User Login Page. This list includes both positive and negative Login Page test scenarios, Security test cases, UI test cases, and a lot more. 

1. Functional Test Cases

Next, let’s check out the functional test cases.

  • Check the cursor if it’s targeting the “Username” text box on the login page (page load) or not.
  • Verify that tab functionality is performing as expected. 
  • Check whether the user can log in with Valid Credentials or not.
  • Verify that the Tab/Enter key performs as a substitute for the Sign-in button.
  • Check that the User fails to Login with an invalid combination of Username and Password. 
  • Verify that the user fails to log in with an invalid Username and valid Password. 
  • Check that the User fails to log in with a valid Username and invalid Password. 
  • Verify that the User fails to Login with a blank Username and Password.
  • Check that the User fails to log in with inactive credentials.
  • Verify that the Login credentials, especially passwords, get saved in a database in an encrypted format. 
  • Check that the Reset button flushes the data from every text box in the Login form. 
  • Verify that validation message is shown in the condition when the User leaves the Username or Password blank.
  • Check that clicking the browser back button post successful login shouldn’t make the user reach to log out mode. 
  • Verify that the validation message is shown when the character limit of the Username and Password fields exceeds.
  • Check that a validation message is shown when a special character is entered in the Username and Password fields.
  • Check the login session’s timeout.
  • Verify that the “Keep me logged in” checkbox stays unchecked by default.
  • Check that when the user clicks the Forgot Password link, he is redirected to the Forgot password page.
  • Verify that the User is redirected to the right page post successful login.
  • Check that the Logout link redirects the user to the home/login page.
  • Verify that when the user clicks the Create/Sign up an account Link, he is redirected to the Create an account page.
  • Check that the User shouldn’t log in successfully with the old password post-changing the password. 
  • Verify that the User login successfully with the new password after he changes the password. 
  • Check whether the User is still Logged in after a sequence of actions, like sign-in, reopening the app, and closing the browser. 
  • Verify that no spaces are allowed before any password characters are attempted. 
  • Check the ways to retrieve passwords when the user forgets his password. 

Build Your Own eCommerce Website

Hire eCommerce Developers

2. Non-Functional Security Test Cases

Security Test Cases for Login Page

Now, we will move on to non-functionality security test cases.

  • Check that clicking the browser back button post successful logout shouldn’t make the user reach logged-in mode.
  • Verify a limit on the total number of unsuccessful Log-in attempts. As per the business logic, the User will be asked to try again post entering the captcha; otherwise, the user will be blocked.
  • Verify that when the password is entered in the password field, it gets saved in a database in a masked format (encrypted).
  • Verify the users shouldn’t copy-paste passwords, as the password can be copy-pasted.
  • Check that the “Remember Password” checkbox is unselected by default.
  • Verify that the encrypted characters in the Password field shouldn’t permit deciphering if copied. 
  • Verify whether the login form is exposing any security information by allowing the page source view. 
  • Check that the Login page is unsafe for SQL injection.
  • Verify whether cross-site scripting (XSS) vulnerability performs on a login page. Hackers may use XSS vulnerability to bypass access controls.

3. Test Scenarios For The Sign-up Page

Ahead, we will know the test scenarios for the sign-up page.

  • Check the messages for every mandatory field. 
  • Verify if the User can’t move ahead, leaving all the mandatory fields empty. 
  • Check the User’s age when the DOB is selected.
  • Verify if the special characters and numbers are not permitted in the First and Last names. 
  • Check if a user can log in to fill invalid details.
  • Verify if a User can successfully sign up by filling in all the mandatory details.
  • Check if the Password field will prompt the User for the weak passwords.
  • Verify if the Password and Confirm Password fields are allowing similar strings only. 
  • Check that the User gets the hints for every field on the form that may ease them.

4. Test Cases For Gmail Login page

Now, we will review the test cases for the Gmail Login page.

  • Check if the user gets a way to enter the password. 
  • Verify if the User gets the correct message if the empty field gets highlighted. 
  • Check if the User will get the correct message on entering an invalid email address.
  • Verify if the User will get the correct message on entering an invalid phone number.
  • Check if the User can log in by entering a valid password and phone number.
  • Check if the User can log in by entering a valid email address and password.
  • Verify if a user can’t log in with an invalid password and a valid phone number. 
  • Check if a user can’t log in with the wrong password and a valid email address. 
  • Check the ‘Forgot Password functionality.
  • Check the ‘Forgot email’ functionality.

Also Read: Checkout flow test cases for ecommerce

5. Test Scenarios For the Login page Of Mobile Application

Login page for mobile app

Next, we will go through test scenarios for the app’s Login page:

  • Check if a user can’t log in with an invalid password or username, check combinations and permutations. 
  • Check if a user can log in with a valid password and username.
  • Verify the option ‘Keep me Sign In’. If this checkbox is selected, check the User can’t get logged out even after he exits the app. 
  • Check if this by default is not selected.
  • Check the ‘Forgot Password functionality.
  • If the User has signed up with social media or Facebook, check if that User can log in using those credentials or not. 
  • Check if the Login page perfectly fits the mobile screen; the user shouldn’t scroll the screen. 

6. Test Cases For CAPTCHA & Cookies (If There Is A Captcha On The Login Page)

CAPTCHA
  • Check whether there’s a client-side validation when the User forgets or doesn’t enter the CAPTCHA.
  • Check that the CAPTCHA’s refresh link is generating a new CAPTCHA. 
  • Verify whether the CAPTCHA holds audio support to listen or not.
  • Check whether the CAPTCHA is case-sensitive or not.
  • Verify if the virtual keyboard is available and performing correctly to enter login credentials in banking apps. 
  • Check two-way authentication through OTP is performing as expected in the case of banking apps. 
  • Check whether the SSL certificate is implemented or not.
  • Check that the User can log in even after cleaning browser cookies. After clearing the cookies, the system shouldn’t permit the User to log in automatically. 
  • Check the login functionality when the User turns off the browser cookies. 

How Do I Test A Login Form?

Login Form

Well, you can follow below:

  • Verify that a Login page doesn’t work with the wrong credentials.
  • Check whether the password text is hidden or not.
  • Check whether the Login performs well with correct credentials. 
  • Verify text field restrictions, whether the browser accepts text even more than the limits. 

Conclusion

The Login page is the foundation for the core features. So, you need to ensure that it functions appropriately; otherwise, your product or software would become useless. 

You need to cover all the possible solutions that can occur during the user interaction with the system. 

If you have an ecommerce project which requires professional expertise then Emizentech’s e-commerce development team can assist you with that. We have built several e-commerce stores on various platforms for clients globally. So, do get in touch for building or testing of an e-commerce website.

Avatar photo
Author

CTO at Emizentech and a member of the Forbes technology council, Amit Samsukha, is acknowledged by the Indian tech world as an innovator and community builder. He has a well-established vocation with 12+ years of progressive experience in the technology industry. He directs all product initiatives, worldwide sales and marketing, and business enablement. He has spearheaded the journey in the e-commerce landscape for various businesses in India and the U.S.

whatsapp