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?
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
Feature | Description | Steps To Execute | Test Data / Input | Expected Results |
---|---|---|---|---|
User Interface | Check all the text boxes, radio buttons, buttons, etc | 1. Click on Radio buttons, buttons, and dropdowns | N/a | UI should be perfect |
Required fields | Check the required fields by not filling any data | 1. Do not enter any value in the field. 2. Click on the Register button. | N/a | It should show a mandatory symbol (*) on mandatory fields. |
Required fields | Check user should Register by filling all the required fields | 1. Enter valid values in the required fields. 2. Click the Register button. | N/a | 1. Users should be registered successfully. 2. A successful registration message should show. 3. Mail should send to the user |
Optional Fields | Check all the optional fields when do not fill in data | 1. Do not enter any detail in optional fields 2. Enter valid data in required fields 3. Click on the Signup button | N/a | 1. 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 Fields | Check all the optional fields when filling data | 1. Enter valid data in optional fields 2. Enter valid data in required fields 3. Click on the Register button | N/a | 1. 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 validation | Check all the valid emails | 1. Enter valid Emails 2. Click on the Register Button. | [email protected] [email protected] | It should not show any validation message |
Phone Number validation | Check the phone number when passing alphanumeric data | 1. Enter alphanumeric data in the phone field 2. Click on the Register button | 1. data5$7567#7 | It should show the validation message 8 for Phone Number |
Phone Number validation | Check the phone number when not passing the country code | 1. Enter valid phone number without country code 2. Click on the Register button | 1. 950002xxxx | It should show the validation message for country code is required |
Phone Number validation | Check the phone number when passing country code | 1. Enter a valid phone number with country code 2. Click on the Register button | 1. +919011xxxx | It should not show any validation message |
Password Validation | Check the password limit when entering a value less than min | 1. Enter a value that is alphanumeric but less than 8. 2. Click on the Register button | 1. Password | It should show a validation message |
Password Validation | Check the password limit when entering a value greater than the max | 1. Enter alphanumeric value but more than 32. 2. Click on the Register button | Any Random string with numbers | It should show a validation message |
Password Validation | Check the password when passing only numbers | 1. Enter a value in numbers which is between 8-32 2. Click on the Register button | 1. 12345678 | It should show a validation message |
Password Validation | Check the password when passing valid data | 1. Enter a value in alphanumeric which is in between 8-32 2. Click on the Register button | 1. Pass123456 | It should not show any validation message |
Required Fields | Verify 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/a | Those Blank spaces should trim and Validation error message for required fields should visible. |
Required Fields | Verify user can verify its Email ID | 1. 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 Validation | Verify 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 | 91901122 | It should show the validation error message for phone number length. |
Phone Number Validation | Verify if the length of the phone number is incorrect i.e. more than 10 | 1. Enter phone number less than 10 digits. 2. Enter all required fields. 3. Click on Register Button | 91901122445566 | It should show the validation error message for phone number length. |
Password Validation | Verify if the password required rules are not satisfied in the password | 1. Enter the password which does not satisfy the required rule. 2. Click on the Register button | password | It should display an error with required rules for password value (like it should contain a special character, a small case, a number) |
Basic Test Cases for a Login Page
Feature | Description | Steps To Execute | Expected Results |
---|---|---|---|
User Interface | Check all the text boxes and buttons | Check Page | • UI should be perfect • Text boxes and buttons should be aligned |
Required Fields | Check 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 Login | Check When passing a correct username and invalid password | 1. 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 Interface | Check Keeping Password | 1. 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 Login | Check when pass correct email and password | 1. Enter a valid username 2. Enter a valid password 3. Click on Login Button | User should log in |
User Login | Check if the password is entered in encrypted | 1. Enter a valid username 2. Enter password 3. Click on Login Button | Password is entered in encrypted form |
Signup Option for new users | Check whether the signup link for the new user is working | Click Signup link | Clicking the signup link takes the user to the signup page successfully |
Forgot Password | Verify 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 Password | Verify 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 Password | Verify the user is able to reset his/her password | 1. 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 Password | Verify user should get an error message when password and confirm password not matches | 1. 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 Password | Verify 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 Password | Verify if the user enters a new password that does not cover the basic requirements of password then the user should be displayed error message | 1. 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 Fields | Verify 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 Email | Verify 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 Login | Verify when passing incorrect Email and correct password | 1. 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 Login | Verify when passing both incorrect Email and password | 1. 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. |
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
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
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)
- 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?
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.