Ecommerce Testing (Part III): How to Write Test Cases for Ecommerce Websites
Oct 16, 2022
As we already might know, an Ecommerce website consists –or should consist, fundamentally, of four key components:
- Home page
- Search Page
- Shopping Cart
- Payment Gateway
We will share some common examples on how to design a test case for each of these.
The home page of Ecommerce websites is commonly full of elements which require thorough testing, since it will be the starting point from where the user is going to explore and learn how to use the site.
Considering elements such as the navigation menu/bar, search box or user account menu, we can derive some test cases from them:
- Home page basic elements
|1.1) User browses to website URL||Home page is served and displayed. Navigation and user account menus, search box –and its category menu filter, store’s main page block containing all the product categories and page footer containing ‘About us’, ‘Contact’ and ‘Terms of Service’ links display correctly. If a user is signed in, their name will display on the user account menu; else, they will be prompted to sign in.|
- Sign in
|2.1) User navigates to the Sign in page by selecting the ‘Sign in’ link from the user account menu.||Login page is served. ‘User’ and ‘Password’ fields, ‘Sign in’ button and ‘Remember user’ checkbox are enabled.|
|2.2) User enters login name and password. Preconditions: both, username and password can’t be longer than 12 characters.||When clicking the ‘Sign in’ button, the user is logged into the system and redirected to the home page.|
If we want our customers and website users to find what they want, it’s essential that the search function works properly.
- Search suggestions
|1.1) User starts typing in the search box. Preconditions: user is standing on the website home page, search bar is visible.||Suggestions matching typed characters start to appear under the search box.|
|1.2) User types a concrete search (an existent product).||Similar or exact coincidences start to appear in the suggestions.|
|1.3) User selects a coincidence.||User is redirected to the search results page. Results are relevant to the search criteria.|
- Search options
|2.2) User performs a search using the category menu to filter results. Preconditions: user is standing on the website home page, search bar and category menu are visible.||Independent of the actual relevance of the results as compared with the terms used for the search criteria, the user is shown results related to the specific category selected in the menu.|
Clear accounts preserve friendship, says an old saying. And we still want to be friends with our customers, so making sure amounts and sums are correct in the shopping cart is crucial.
- Add Item to Cart
|1.1) User selects a product and adds it to the shopping cart by clicking/tapping on the ‘Add to Cart’ button/link. Preconditions: user is either standing on a search results page or on a product page. Item counter shows (x) number of items.||Product is correctly added to the cart, and the counter now shows (x + 1) items.|
- Remove Item from Cart
|2.1) User selects a product from the cart and removes it by clicking/tapping ‘Remove item’ link/button. Preconditions: user is standing inside the shopping cart, the cart has at least 1 item.||Item is removed from the cart, the counter now shows (x – 1) items.|
- Redirect to Checkout
|3.1) User clicks/taps on the ‘Checkout’ link/button. Preconditions: user is standing inside the shopping cart, the cart has at least 1 item and the ‘Checkout’ button is visible.||User is redirected to the checkout page. Sum totals for items on cart, taxes and shipping costs are correctly calculated and displayed. Payment methods –as announced– are visible and enabled.|
Ensuring money and personal data is safely manipulated builds trust in customers, hence the importance of rigorously testing our payment gateway.
- Choosing Payment Method from Checkout page
|1.1) User selects payment method. Preconditions: user is standing in the checkout page –ready to place an order. At least one payment method/provider must be configured.||Payment method is selected and displays its identity characteristics (e. g.: the last 4 characters of a credit card, etc). ‘Place Order’ button is visible.|
We’ve covered, very roughly, examples on how to design possible test cases for an Ecommerce website. Logically, these are almost infinitely extensible. The idea is merely to show how to approach what are considered the most important components of an Ecommerce platform and start building from it.