Manual testing guide

20 Shopping Cart Test Cases for Ecommerce

The shopping cart connects product discovery with checkout. Strong coverage verifies that item state, quantities and totals stay trustworthy across navigation, authentication, stock changes and multiple devices.

Example requirement

A customer can add available products to a shopping cart, change quantities, remove items and proceed to checkout. The cart must show accurate prices and promotions, respect stock limits and preserve state according to the documented guest and signed-in rules.

Generate test cases for this example

20

Test cases

6

Coverage types

12

High priority

CSV

Export format

How to test a shopping cart

Treat the cart as a changing calculation and state-management feature. Each item update can affect availability, promotions, totals and what reaches checkout.

  • Verify add, update, remove and empty-cart flows.
  • Test quantity and stock boundaries before checkout.
  • Recalculate prices, promotions and totals after every change.
  • Cover guest persistence, sign-in merging and multiple tabs.

20 example test cases

Filter the coverage, switch between card and table views, then copy or export the cases you need. Replace assumptions with the confirmed rules, environments and risks of your product.

Showing 20 of 20 cases

CART-001FunctionalHigh priority

Add an available product to the cart

Precondition

An in-stock product is available.

Expected result

The selected product, options, quantity and current price appear once in the cart.

Steps

  1. 1.Open the product page
  2. 2.Choose required options
  3. 3.Select Add to cart
  4. 4.Open the cart
CART-002FunctionalHigh priority

Increase and decrease item quantity

Precondition

The cart contains an item with stock above one.

Expected result

Quantity and all dependent totals update accurately after each change.

Steps

  1. 1.Increase the quantity
  2. 2.Review totals
  3. 3.Decrease the quantity
CART-003FunctionalHigh priority

Remove an item from the cart

Precondition

The cart contains at least one item.

Expected result

The item is removed once and cart count, subtotal, discount and total are recalculated.

Steps

  1. 1.Select Remove for the item
  2. 2.Confirm removal if required
CART-004BoundaryHigh priority

Prevent quantity above available stock

Precondition

An item has a known limited stock quantity.

Expected result

The allowed quantity is accepted and the over-stock quantity is blocked with clear guidance.

Steps

  1. 1.Set quantity to the stock limit
  2. 2.Attempt to increase it by one
CART-005UsabilityMedium priority

Show a useful empty-cart state

Precondition

The cart is empty.

Expected result

The page clearly identifies the empty state and offers an accessible path back to shopping.

Steps

  1. 1.Open the cart
  2. 2.Review the message and available actions
CART-006FunctionalHigh priority

Apply a valid promotion to eligible items

Precondition

The cart qualifies for a valid promotion.

Expected result

The promotion is applied once to eligible items and the calculation matches the documented rule.

Steps

  1. 1.Enter the promotion code
  2. 2.Apply it
  3. 3.Review item and cart totals
CART-007FunctionalHigh priority

Keep the cart after page refresh

Precondition

Cart persistence is enabled and the cart contains items.

Expected result

Cart contents and approved selections persist without duplication according to policy.

Steps

  1. 1.Refresh the cart page
  2. 2.Navigate away and return
CART-008AccessibilityMedium priority

Operate the cart using only the keyboard

Precondition

The cart contains adjustable and removable items.

Expected result

Focus is visible and every cart action is labelled and operable without a pointer.

Steps

  1. 1.Navigate cart controls using the keyboard
  2. 2.Change quantity
  3. 3.Remove an item
  4. 4.Proceed toward checkout
CART-009NegativeMedium priority

Reject an invalid promotion code

Precondition

The cart contains an eligible product and an invalid code is available.

Expected result

No discount is applied and the cart contents remain unchanged with a clear message.

Steps

  1. 1.Enter the invalid code
  2. 2.Apply it
CART-010FunctionalMedium priority

Remove an applied promotion

Precondition

A promotion is applied to the cart.

Expected result

The discount is removed once and every affected amount is recalculated correctly.

Steps

  1. 1.Remove the promotion
  2. 2.Review all totals
CART-011BoundaryHigh priority

Handle a product price change

Precondition

A product in the cart can receive a new authoritative price.

Expected result

The updated price is explained and shown before the customer proceeds to payment.

Steps

  1. 1.Add the product
  2. 2.Change its price through the test fixture
  3. 3.Refresh or reopen the cart
CART-012BoundaryHigh priority

Handle an item becoming out of stock

Precondition

A cart item can become unavailable.

Expected result

The unavailable item is clearly identified and cannot proceed to checkout as purchasable stock.

Steps

  1. 1.Add the available item
  2. 2.Set its stock to zero
  3. 3.Open the cart
CART-013FunctionalHigh priority

Merge a guest cart after sign-in

Precondition

The guest and account carts contain known items.

Expected result

Items are merged according to the documented rule without loss, duplication or invalid quantities.

Steps

  1. 1.Add an item as a guest
  2. 2.Sign in to the account
  3. 3.Review the merged cart
CART-014BoundaryMedium priority

Synchronise cart changes across tabs

Precondition

The same cart is open in two browser tabs.

Expected result

Both tabs converge on the authoritative cart without restoring stale items.

Steps

  1. 1.Change quantity in the first tab
  2. 2.Remove the item in the second tab
  3. 3.Refresh both tabs
CART-015SecurityHigh priority

Prevent a tampered client price

Precondition

A safe test environment permits request inspection.

Expected result

Server-side pricing overrides or rejects the tampered value and no discounted order can be created.

Steps

  1. 1.Alter the client-supplied item price
  2. 2.Submit the cart update
  3. 3.Review the authoritative total
CART-016NegativeHigh priority

Reject a negative or non-numeric quantity

Precondition

Cart quantity can be edited.

Expected result

Invalid values are rejected or normalised according to policy without corrupting the cart.

Steps

  1. 1.Enter negative, decimal, text and blank quantities
  2. 2.Submit each value
CART-017BoundaryMedium priority

Support the maximum allowed cart size

Precondition

The maximum item or line count is documented.

Expected result

The maximum valid cart works and the over-limit addition is blocked with useful guidance.

Steps

  1. 1.Add items up to the limit
  2. 2.Attempt to add one more
CART-018FunctionalHigh priority

Preserve selected product variants

Precondition

A product has multiple size or colour options.

Expected result

The exact selected variant persists and is used for price and availability checks.

Steps

  1. 1.Choose a specific variant
  2. 2.Add it to the cart
  3. 3.Refresh and reopen the cart
CART-019AccessibilityMedium priority

Announce cart updates to screen readers

Precondition

A screen reader is available.

Expected result

Meaningful status updates are announced without unexpectedly moving keyboard focus.

Steps

  1. 1.Add an item
  2. 2.Change its quantity
  3. 3.Remove it
CART-020UsabilityMedium priority

Keep cart controls usable on mobile

Precondition

A supported mobile viewport is available.

Expected result

Products, totals and controls remain readable and easy to operate without horizontal scrolling.

Steps

  1. 1.Open a populated cart
  2. 2.Change quantity and remove an item
  3. 3.Proceed to checkout

Coverage checklist

  • Use products with different prices, options and stock states.
  • Recalculate subtotal, discount, tax estimates and total after every change.
  • Confirm guest and signed-in persistence rules across sessions and devices.
  • Test price and stock changes before checkout begins.
  • Verify keyboard use, live announcements and mobile touch targets.

Common defects

  • • Quantity changes do not update every total.
  • • Guest items disappear or duplicate after sign-in.
  • • Stale price or stock reaches checkout.
  • • Promotions remain applied after eligibility is lost.
  • • Repeated taps create duplicate line items.

Suggested test data

  • • In-stock, low-stock and unavailable products
  • • Single and multiple product variants
  • • Valid, invalid, expired and minimum-spend promotions
  • • Guest and signed-in carts with overlapping items
  • • Quantities at, below and above stock limits

Automation notes

  • • Assert authoritative backend cart state as well as visible totals.
  • • Create deterministic stock, price and promotion fixtures for boundary tests.
  • • Keep multi-tab and cross-device synchronisation tests isolated from parallel runs.

Frequently asked questions

What test cases are important for a shopping cart?+

Prioritise adding, updating and removing items; totals; stock limits; price changes; promotions; persistence; guest-to-user merging; and checkout handoff.

How do you test shopping cart calculations?+

Use known prices and quantities, then verify subtotal, discounts, tax estimates and totals after every add, update, remove and promotion action.

Should a shopping cart persist after logout?+

That is a product decision. Testing should verify the documented guest, signed-in, logout and expiry rules without leaking one user's cart to another.

Related test case examples

Generate cases for your own requirement

Paste your real user story, choose the coverage categories and receive structured manual test cases you can review and export.

Open the free generator