Back to guides

GUIDE / manual

Test Cases for an E-commerce Website

Complete test cases for an e-commerce website: catalog, cart, checkout, payments, orders, returns, and risk-based QA coverage with clear examples.

By The Testing AcademyPublished July 9, 2026Updated July 9, 202616 min read

If you are building test cases for an e-commerce website, you are protecting revenue, inventory integrity, and customer trust at the same time. An ecommerce system is not one page. It is a chain: discover product, evaluate details, add to cart, apply offers, calculate tax and shipping, pay, fulfill, and support returns. A defect anywhere in that chain can mean abandoned carts, overselling, undercharging, or broken order history.

This guide gives you a practical, risk-based suite design for ecommerce testing. You will get module-by-module scenarios, sample cases, prioritization for release and sale events, payment and inventory checks, and common mistakes teams make when they only test the happy path with a perfect card and one in-stock SKU.

Test Cases for an E-commerce Website: Scope Map

Break the product into modules so cases stay maintainable.

  1. Home and navigation.
  2. Search and category browse.
  3. Product detail page (PDP).
  4. Cart.
  5. Checkout and address.
  6. Pricing, tax, shipping, coupons.
  7. Payments.
  8. Order confirmation and notifications.
  9. Customer account and order history.
  10. Inventory and catalog admin effects.
  11. Returns, cancellations, refunds.
  12. Cross-cutting: auth, mobile, accessibility, performance smoke, security.

You will not execute every case every day. You will always know where each case lives.

Risk-Based Priority Model

Risk areaWhy it mattersDefault priority
Checkout and payment successDirect revenueP0
Cart price integrityOver/under chargeP0
Inventory decrementOversell/undersellP0
Login and account ordersTrust and privacyP0
Search finds key productsConversionP1
Coupons and promotionsMargin leakageP1
Shipping/tax calculationsLegal and support costP1
Returns/refundsCost and complianceP1
Wishlist/recommendationsConversion supportP2
Cosmetic merchandisingBrand, lower direct riskP2/P3

When time is short, defend P0 first. For writing quality and structure, use how to write test cases as your baseline craft guide.

For commerce flows that accept receipts, prescriptions, returns evidence, or bulk product files, add focused test cases for file upload to the relevant module.

Module 1: Navigation, Home, and Catalog Browse

IDTitleExpected
TC-ECOM-001Home page loads key entry pointsSearch, cart, login, featured categories visible
TC-ECOM-002Category navigation opens correct listingProducts match category
TC-ECOM-003Breadcrumbs reflect hierarchyCorrect path and links work
TC-ECOM-004Sort by price ascendingOrder is correct for displayed currency
TC-ECOM-005Sort by newestOrder matches catalog rules
TC-ECOM-006Filter by brand/size/colorOnly matching products shown
TC-ECOM-007Clear filtersFull listing restored
TC-ECOM-008Pagination or infinite scrollNo duplicates, no missing page items
TC-ECOM-009Empty category stateHelpful empty message
TC-ECOM-010Sold out badge appears when stock is zeroBadge and constrained CTA match rules

Search deserves its own deep suite. Summarize core ecommerce search cases here and link out for depth to test cases for search functionality.

IDTitleExpected
TC-ECOM-020Exact product name searchTarget product in results
TC-ECOM-021Partial keyword searchRelevant matches
TC-ECOM-022No results queryEmpty state and suggestions if any
TC-ECOM-023Search result price matches PDPSame price before discounts rules
TC-ECOM-024Out of stock products handlingShown/hidden per config

Module 3: Product Detail Page (PDP)

PDP defects cause wrong purchases.

IDTitleExpected
TC-ECOM-030Product title, images, price renderContent correct for SKU
TC-ECOM-031Variant selection updates price/SKUCorrect SKU selected
TC-ECOM-032Variant out of stockCannot add that variant
TC-ECOM-033Quantity default and changeBounds respected
TC-ECOM-034Add to cart from PDPCart count and line item correct
TC-ECOM-035Add to wishlist if presentItem saved to wishlist
TC-ECOM-036Product description formattingNo broken layout, safe HTML
TC-ECOM-037Reviews list paginationStable ordering
TC-ECOM-038Low stock messagingShows when below threshold
TC-ECOM-039Image gallery navigationAll images reachable

Detailed example:

Test Case ID: TC-ECOM-031
Title: Verify selecting size and color updates selectable SKU and price
Preconditions: Product has size S/M and color Black/Blue with different stock/price rules
Steps:
  1. Open PDP for configurable product.
  2. Select Black and M.
  3. Observe price, stock state, and SKU or data attributes if visible.
  4. Change to Blue and S.
Expected:
  - Displayed price matches the selected variant.
  - Add to cart targets the selected variant only.
  - Stock state matches that variant, not the parent product aggregate incorrectly.

Module 4: Cart Test Cases

Cart is the bridge between intent and checkout.

IDTitleExpected
TC-ECOM-040Add single itemLine created with correct unit price
TC-ECOM-041Add same item againQuantity increments per rules
TC-ECOM-042Add different variantsSeparate lines if variants differ
TC-ECOM-043Update quantity upwardTotals recalculate
TC-ECOM-044Update quantity downwardTotals recalculate
TC-ECOM-045Set quantity to zero or removeLine removed
TC-ECOM-046Quantity above stockBlocked with message
TC-ECOM-047Quantity below minimumBlocked if min pack size exists
TC-ECOM-048Cart persistence for guestSurvives browser refresh
TC-ECOM-049Cart merge after loginGuest and user carts merge per policy
TC-ECOM-050Remove all itemsEmpty cart state
TC-ECOM-051Price change while item in cartPolicy: update price or lock, user informed
TC-ECOM-052Item becomes out of stock in cartCannot checkout that item

Calculation checks

Always verify:

  • Line total = unit price x quantity (after line discounts if any).
  • Subtotal sums lines correctly.
  • Taxes and shipping appear only where designed (cart vs checkout).
  • Currency symbols and decimal precision are correct.
IDTitleExpected
TC-ECOM-053Subtotal with two linesExact arithmetic match
TC-ECOM-054Discounted line itemDiscount applied once, not duplicated on refresh

Module 5: Coupons, Promotions, and Loyalty

Promotions are notorious for margin bugs.

IDTitleExpected
TC-ECOM-060Valid percentage couponCorrect discount amount
TC-ECOM-061Valid fixed amount couponCorrect discount, not below zero incorrectly
TC-ECOM-062Expired couponRejected
TC-ECOM-063Not yet active couponRejected
TC-ECOM-064Coupon below minimum cart valueRejected
TC-ECOM-065Coupon restricted to categoryWorks only for eligible items
TC-ECOM-066Single-use coupon second attemptRejected
TC-ECOM-067Stacking two couponsAllowed only if policy permits
TC-ECOM-068Remove couponTotals restore
TC-ECOM-069Coupon after cart changeRevalidated, not silently wrong
TC-ECOM-070Free shipping promo thresholdShipping becomes zero when met

Regression classic:

Title: Coupon not duplicated after checkout page refresh
Steps:
  1. Apply SAVE10.
  2. Confirm discount once.
  3. Refresh checkout.
Expected:
  - Discount remains applied once.
  - Payable total is unchanged and correct.

Module 6: Checkout, Address, Shipping, Tax

IDTitleExpected
TC-ECOM-080Guest checkout available if enabledCan proceed without full account
TC-ECOM-081Logged-in checkout uses saved addressAddress prefilled correctly
TC-ECOM-082Required address fields validationMissing fields block progress
TC-ECOM-083Invalid postal code formatRejected
TC-ECOM-084Shipping methods for destinationOnly valid methods shown
TC-ECOM-085Shipping cost updates on method changeTotals update
TC-ECOM-086Tax calculation for region ATax matches rule engine
TC-ECOM-087Tax-exempt scenario if supportedTax zero with valid exemption
TC-ECOM-088Order review shows accurate summaryItems, discounts, shipping, tax, total
TC-ECOM-089Edit cart from checkoutReturns and recalculates safely
TC-ECOM-090Double click place orderOnly one order created

Use realistic addresses per market. Fake happy-path addresses often miss validation rules.

Module 7: Payment Test Cases

Never treat payment as a black box you ignore. Use sandbox modes.

IDTitleExpected
TC-ECOM-100Successful card paymentOrder paid, confirmation shown
TC-ECOM-101Declined cardNo paid order, recoverable error
TC-ECOM-102Expired cardRejected with clear reason class
TC-ECOM-103Incorrect CVVRejected
TC-ECOM-104Insufficient fundsRejected, cart preserved if policy says so
TC-ECOM-1053DS challenge successPayment completes after challenge
TC-ECOM-1063DS challenge failureNo capture, order not marked paid
TC-ECOM-107User cancels on payment providerReturns safely, no charge
TC-ECOM-108Payment timeoutOrder state is consistent, no silent charge
TC-ECOM-109Alternative method (wallet/COD/UPI/etc.)Method-specific success path works
TC-ECOM-110Paid order inventory committedStock reduced according to policy
TC-ECOM-111Failed payment inventory not stolenStock not permanently decremented incorrectly

Order vs payment consistency matrix

Payment resultExpected order statusInventoryUser messaging
SuccessPaid / confirmedDecrementedConfirmation
DeclineFailed / pending paymentNot taken or releasedRetry guidance
Cancel at providerCancelled/pendingReleasedCan retry
Timeout unknownPending reconciliation stateLocked temporarily or per design"Processing" guidance

Inconsistent states here create serious finance and support problems.

Module 8: Order Confirmation, Notifications, Account

IDTitleExpected
TC-ECOM-120Confirmation page order numberUnique ID shown
TC-ECOM-121Confirmation email contentItems, total, address correct
TC-ECOM-122Order visible in account historySame totals and status
TC-ECOM-123Unauthorized user cannot open order URLAccess denied
TC-ECOM-124Invoice download if availableCorrect amounts
TC-ECOM-125Cancel order before fulfillmentStatus updated, payment void/refund rules apply
TC-ECOM-126Order status progressionPending -> paid -> shipped -> delivered as designed

Security note: insecure direct object references on /orders/{id} are common. Include authorization cases.

Module 9: Inventory and Catalog Consistency

IDTitleExpected
TC-ECOM-130Purchase reduces stockStock decreases by purchased qty
TC-ECOM-131Two users compete for last itemOnly one successful paid purchase
TC-ECOM-132Admin sets stock to zeroPDP/cart prevent purchase
TC-ECOM-133Backorder allowed if configuredMessaging and promise dates correct
TC-ECOM-134Bundle product stockBundle rules enforce component availability

Race conditions around last-item purchases are high value and often missed in single-threaded manual tests. Include at least a planned concurrent scenario for big sales.

Module 10: Returns, Refunds, Exchanges

IDTitleExpected
TC-ECOM-140Eligible order starts returnReturn request created
TC-ECOM-141Outside return windowRequest blocked
TC-ECOM-142Partial return quantityRefund amount proportional per policy
TC-ECOM-143Restocking fee if anyFee calculated correctly
TC-ECOM-144Refund methodOriginal payment method or store credit per rules
TC-ECOM-145Exchange flowReplacement order or adjustment correct

Auth and Account Touchpoints

Ecommerce depends on auth for saved addresses, order history, and wishlist. Include a thin slice of login/register coverage and link deeper suites:

IDTitleExpected
TC-ECOM-150Login from checkoutReturns user to checkout, cart intact
TC-ECOM-151Logout clears private order data from UINo easy access to previous account orders on shared device

Mobile, Accessibility, and Cross-Browser Smoke

Revenue often happens on mobile.

IDTitleExpected
TC-ECOM-160Mobile add to cart and checkout smokeCan complete purchase on target mobile browser
TC-ECOM-161Sticky cart/checkout CTAs usableNot obscured by banners
TC-ECOM-162Keyboard navigate critical pathSearch -> PDP -> cart -> checkout fields usable
TC-ECOM-163Form errors announcedAddress/payment errors understandable

You do not need full WCAG audit in every ecommerce regression, but smoke accessibility on money paths is justified.

End-to-End Journey Cases

Keep a small number of journey cases in addition to modular tests.

Journey A: Guest buys in-stock simple product

  1. Search product.
  2. Open PDP.
  3. Add to cart.
  4. Checkout as guest.
  5. Pay successfully.
  6. Receive confirmation.

Journey B: Logged-in user buys variant with coupon

  1. Login.
  2. Select variant.
  3. Apply coupon.
  4. Pay with 3DS success.
  5. Verify order history.

Journey C: Payment decline recovery

  1. Add item.
  2. Pay with decline fixture.
  3. Retry with success fixture.
  4. Confirm single successful order and correct stock.

Journeys prove integration. Modular cases diagnose failures faster.

Sample High-Value Mini Suite (Release Smoke)

  1. Search key SKU.
  2. PDP variant select and add.
  3. Cart quantity update totals.
  4. Valid coupon apply/remove.
  5. Checkout address validation.
  6. Successful payment.
  7. Confirmation + order history.
  8. Failed payment does not mark paid.
  9. Out of stock cannot checkout.
  10. User A cannot open user B order.

If these ten pass, the store is not "fully tested," but it is often testable and revenue-safe enough for deeper runs.

Test Data and Environment Needs

Ecommerce testing quality depends on data.

Data needExample
In-stock simple SKUAlways available product
Low-stock SKUStock = 1
Configurable variantsSize/color matrix
Coupon setvalid, expired, restricted, single-use
Usersguest path, buyer, buyer with prior orders
Addressesdomestic valid, invalid postal, international if supported
Payment fixturessuccess, decline, 3DS

Reset coupons and stock regularly. Shared sandbox pollution creates false failures.

Common Mistakes in Ecommerce Test Cases

Mistake 1: Only happy path with one product

Misses variants, coupons, declines, and stock races.

Mistake 2: Not validating money math

"Looks roughly right" is not an expected result. Compute exact totals.

Mistake 3: Ignoring order/payment state consistency

UI success with unpaid order, or charge without order, are critical defects.

Mistake 4: No authorization tests on orders

IDOR issues leak personal purchase data.

Mistake 5: Cart tested without login merge rules

Guest-to-user transitions break often.

Mistake 6: Treating coupons as cosmetic

Promotions are financial logic.

Mistake 7: No mobile checkout execution

Desktop-only confidence is false confidence for many stores.

Mistake 8: Unmaintainable mega cases only

A 90-step case that buys everything helps demos, not debugging. Balance journeys and atomic cases.

Using Boundaries in Ecommerce Inputs

Quantity, coupon codes, address lengths, and postal fields all benefit from boundary thinking. For technique detail, see boundary value analysis and equivalence partitioning.

Examples:

  • Quantity min, min-1, max stock, max stock+1.
  • Coupon max uses.
  • Address line max length.
  • Phone field bounds.

Automation Candidates vs Manual Focus

Automate first:

  • Critical journey smoke.
  • Cart calculations for fixed fixtures.
  • Coupon application arithmetic with stable promos.
  • Authz checks on order endpoints if API accessible.
  • Out of stock CTA state with controlled stock APIs.

Keep manual/exploratory:

  • Visual merchandising.
  • Complex promotion combinations newly launched.
  • Usability of mobile payment sheets.
  • Content correctness of new campaign pages.

Sale Event and Flash Sale Checklist

Before high traffic campaigns:

  1. P0 smoke on production-like env.
  2. Coupon codes for the event.
  3. Inventory for featured SKUs.
  4. Payment provider status and 3DS paths.
  5. Mobile checkout.
  6. Order confirmation email deliverability sample.
  7. Feature flags and fallback plan.
  8. Monitoring dashboards for checkout errors.
  9. Load awareness of search and checkout APIs.
  10. Rollback owner identified.

Testing is part of sale readiness, not a postmortem tool.

Practice Plan

Use a demo store or staging catalog and build:

  1. A module map.
  2. 30 scenarios across cart, checkout, payment.
  3. 15 fully detailed cases with exact expected totals.
  4. A 10-case smoke pack.
  5. A list of open questions on tax and coupon stacking.

To sharpen speed and prioritization under pressure, practice scenario design in QABattle battles and then convert notes into formal ecommerce cases.

Review Checklist

  • Money paths covered end to end.
  • Cart math verified.
  • Payment success and failure covered.
  • Inventory effects covered.
  • Coupon rules covered for active promos.
  • Order history and authz covered.
  • Mobile smoke covered.
  • Guest and logged-in paths considered.
  • Returns policy covered if live.
  • Test data reset strategy exists.
  • P0 suite can run quickly before release.

Conclusion

High quality test cases for an e-commerce website delivery start from revenue risk, not from random page tours. Cover discovery, PDP accuracy, cart integrity, checkout calculations, payment truth, inventory, and account order privacy. Use modular cases for diagnosis and a few journeys for integration confidence. Exact expected totals, state consistency, and out-of-stock behavior matter as much as button clicks.

If your suite can answer, "Can a real customer reliably pay the right amount for an available product and see the right order afterward?" you are focused on the right ecommerce outcome. Expand from that core with promotions, returns, and edge markets as your business model demands.

FAQ

Questions testers ask

What are the most important test cases for an ecommerce website?

Prioritize product discovery, product detail accuracy, add to cart, cart calculations, checkout validation, payment success and failure, order confirmation, inventory updates, and order history. These paths protect revenue. Expand into coupons, shipping, tax, returns, and accounts based on your business model.

How do you test an online shopping cart?

Test add, remove, update quantity, min/max quantity, out of stock handling, price and tax recalculation, coupon application, persistence across sessions, and cart merge after login. Verify line totals, discounts, shipping estimates, and that unavailable items cannot be purchased.

What should checkout test cases include?

Include guest and logged-in checkout, address validation, shipping method selection, tax calculation, payment method handling, order review accuracy, place order success, failure recovery, double-submit protection, and confirmation email or page content with correct order details.

How do you test payment gateway integration?

Use sandbox credentials to test successful payment, declined card, expired card, insufficient funds, 3-D Secure challenge success and failure, cancellation mid-payment, network timeout, and reconciliation of order status against payment status. Never use real customer cards in shared tests.

What negative test cases matter in ecommerce?

Out of stock purchase attempts, invalid coupons, expired coupons, quantity above stock, invalid addresses, payment declines, unauthorized access to other users' orders, negative quantities, and replaying place-order requests. Negative cases protect revenue leakage and data exposure.

How do you prioritize ecommerce testing before a sale event?

Run smoke on browse-search-cart-checkout-pay, then deep checks on coupons, inventory, peak payment methods, mobile checkout, and order confirmation. Add performance awareness for traffic spikes. Freeze low-risk cosmetic tests and focus on money paths and rollback readiness.