Skip to main content
Skip to content

E-Commerce Test Cases: 16 Sample Test Cases with Steps and Expected Results

E-Commerce Test Cases

This is a library of sample e-commerce test cases you can copy into your test management tool and adapt. Each case has an ID, priority, test data, steps and expected results. They cover the core journey: register, log in, find products, add to cart and check out. For the bigger picture of what to test and why, read our ecommerce testing guide. For a checklist organised by area of the site, see test cases for online shopping websites.

Before you start

  • Use sandbox data. Test payments with your gateway’s test cards, never real cards. If you need dummy card numbers for validation checks, see our credit card generator, which produces numbers that pass format checks but cannot be charged.
  • Use a future expiry date in card test data. Examples below say “a future date” so the cases do not go out of date.
  • Protect personal data. Use made up users and addresses. For general guidance on protecting sensitive customer data, see IBM’s overview.
  • Treat these as templates. Field names, validation rules and messages will differ in your store.

Account and checkout cases

TC001: User registration

Priority: High. Type: Valid.
Purpose: A new user can register.
Pre-condition: The user is not registered.
Test data: username testuser, a strong password, and a unique email address.

Step Description Expected result
1 Open the store. The home page is displayed.
2 Click “Register”. The registration form is displayed.
3 Enter username, password and email. The values are accepted with no validation errors.
4 Click “Submit”. The account is created and the user is logged in, or asked to confirm the email, as designed.

Add negative variants: an existing email, a weak password, an invalid email format and empty required fields.

TC002: User login

Priority: High. Type: Valid.
Purpose: A registered user can log in.
Pre-condition: The account exists.

Step Description Expected result
1 Open the login form. The login form is displayed.
2 Enter the correct username and password. The values are accepted.
3 Click “Submit”. The user is logged in and sees their account.

TC003: Invalid login

Priority: Medium. Type: Invalid.
Purpose: An error is shown for wrong credentials.
Test data: an unknown username and any password.

Step Description Expected result
1 Open the login form and enter the wrong credentials. The values are entered.
2 Click “Submit”. A clear error says the credentials are invalid. The message does not reveal which part was wrong. The user stays logged out.

TC004: Add product to cart

Priority: High. Type: Valid.
Purpose: A user can add a product to the cart.
Test data: product “Laptop” (in stock).

Step Description Expected result
1 Open the product page for “Laptop”. The product page is displayed with price and stock status.
2 Click “Add to Cart”. The product is added and the cart count increases by one.
3 Open the cart. The cart shows “Laptop” with the correct price, quantity and subtotal.

TC005: Checkout with a card

Priority: High. Type: Valid.
Purpose: A user can complete a purchase.
Pre-condition: The cart has at least one product.
Test data: a test address, payment method “Credit Card”, a gateway test card number, a future expiry date and a test CVV.

Step Description Expected result
1 Open the cart and click “Checkout”. The checkout page is displayed with the order summary.
2 Enter the shipping address. The address is accepted and shipping cost and tax are calculated.
3 Select “Credit Card” and enter the card details. The card fields accept valid input.
4 Click “Place Order”. The order is placed once, a confirmation page and email are shown, and stock reduces.

Add negative variants: declined card, expired card, wrong CVV, empty address, and a double click on “Place Order” (no duplicate order or charge).

Filter and sort cases

All of these start on the product listing page. Each follows the same simple pattern: choose an option and check the list.

ID Test case Test data Expected result Priority
TC006 Filter by category Electronics Only Electronics products are shown High
TC007 Filter by price range $100 to $500 Only products priced within the range are shown, including the boundary values High
TC008 Filter by brand Apple Only products of that brand are shown Medium
TC009 Filter by rating 4 stars and above Only products rated 4 or higher are shown Medium
TC010 Filter with no results An unavailable category and a very high price range A clear “no products found” message is shown, with a way to reset Low
TC011 Sort by price, low to high None Lowest price first High
TC012 Sort by price, high to low None Highest price first High
TC013 Sort by rating None Highest rated first Medium
TC014 Sort by newest arrivals None Newest products first Medium
TC015 Combined filter and sort Electronics, $100 to $500, price low to high Filtered results are sorted correctly Medium
TC016 Reset filters Filters already applied All filters clear and all products show Low

More cases worth adding

  • Apply a valid, an invalid and an expired coupon.
  • Change quantity and remove an item; totals update.
  • Cart persistence after logout and login.
  • Out of stock product cannot be purchased.
  • Order confirmation, cancellation and refund flow.
  • Checkout on mobile browsers.

Conclusion

Good e-commerce test cases are specific, repeatable and prioritised toward the money path: product, cart, checkout and payment. Use this library as a start, add negative cases, and automate the stable ones. The wider strategy lives in the ecommerce testing guide.

Part of our guide to Ecommerce Testing. Start with the complete Ecommerce Testing guide, or read the related articles:

Want more testing guides in your Google results? Add Testmetry as a preferred source.

Share it :

Leave a Reply