~/qa-guides/shopping-cart-test-cases-checklist
>_ Shopping Cart Test Cases Checklist
Ready-to-use shopping cart test cases for add to cart, variants, quantities, discounts, guest cart, cart merge, mobile cart, APIs, analytics, and checkout handoff.
Short answer
A Shopping Cart Test Cases Checklist is a set of ready-to-use test cases for checking the cart in an e-commerce store, marketplace, SaaS checkout, or any product where users add products, plans, or services before placing an order.
This article is different from a Shopping Cart Testing Checklist. A Shopping Cart Testing Checklist explains which cart areas should be tested: add to cart, quantity, remove item, variants, discounts, guest cart, cart merge, stock, mobile behavior, and analytics.
A Shopping Cart Test Cases Checklist gives specific test case examples:
- what to test;
- which preconditions are needed;
- which steps to perform;
- what expected result should happen;
- which edge cases should not be missed.
The main idea is: shopping cart test cases turn general cart testing into specific, repeatable scenarios.
---
Shopping Cart Test Cases vs Shopping Cart Testing Checklist
A Shopping Cart Testing Checklist answers the question: which cart areas should be covered by testing?
For example:
- add to cart;
- cart page;
- cart drawer;
- quantity;
- remove item;
- subtotal;
- promo code;
- cart persistence;
- guest cart;
- logged-in cart;
- cart merge;
- stock;
- mobile cart;
- cart analytics.
A Shopping Cart Test Cases Checklist answers the question: which specific test cases can be executed?
For example:
- add one available product to cart;
- add the same product twice;
- add the same product with different variants;
- update quantity from 1 to 3;
- remove the last item from cart;
- refresh page after adding an item;
- log in after creating a guest cart;
- try to checkout with an out-of-stock item;
- verify subtotal after promo code;
- verify cart on mobile.
In simple terms: a testing checklist is the coverage map, while a test cases checklist is the set of specific scenarios.
---
When to use Shopping Cart Test Cases
Use these shopping cart test cases when you need to verify cart behavior before a release, regression cycle, checkout update, or e-commerce launch.
For example:
- a new e-commerce site is launching;
- cart page is changing;
- cart drawer is changing;
- add to cart logic is changing;
- product variants are added;
- quantity selector is changing;
- prices or discounts are changing;
- promo code logic is changing;
- guest cart is added;
- cart merge after login is changing;
- inventory logic is changing;
- mobile cart is changing;
- a duplicate item bug is being fixed;
- a lost cart bug is being fixed;
- a wrong subtotal bug is being fixed;
- a checkout release is being prepared;
- regression testing is being performed before production deployment.
These test cases can be used as a base for manual QA, regression testing, exploratory testing, or automation candidates.
---
Test case format for shopping cart
For shopping cart test cases, a simple format works well:
Test case: what is being tested. Preconditions: what should be prepared. Steps: what the user does. Expected result: what should happen.
For example:
Test case: Add one available product to cart.
Preconditions:
- product is active;
- product is in stock;
- user is on product page.
Steps:
- open product page;
- click Add to Cart;
- open cart.
Expected result:
- product appears in cart;
- product name is correct;
- price is correct;
- quantity is 1;
- cart count is updated;
- subtotal is correct.
This format is easy to read, easy to move into a test management tool, and easy to convert into automated tests.
---
Short Shopping Cart Test Cases Checklist
If you need a quick cart test, start with these scenarios:
- add one product to cart;
- add product with selected variant;
- add same product twice;
- update quantity;
- remove item;
- remove last item and check empty cart;
- refresh page and verify cart persistence;
- add product as guest user;
- log in and verify cart merge;
- apply valid promo code;
- apply invalid promo code;
- try to add out-of-stock product;
- verify subtotal and total preview;
- proceed to checkout;
- verify checkout receives correct product, variant, quantity, and price;
- check cart on mobile;
- verify no duplicate cart items after double click;
- verify add to cart analytics event.
This is the minimum set. For complete coverage, use the full list below.
---
Shopping Cart Test Cases Checklist
1. Add one available product to cart
Preconditions:
- product is active;
- product is in stock;
- product has no required variants or default variant is selected.
Steps:
- open product page;
- click Add to Cart;
- open cart drawer or cart page.
Expected result:
- product is added to cart;
- product name is correct;
- product image is correct;
- price is correct;
- quantity is 1;
- cart count is updated;
- subtotal is correct;
- user sees clear feedback that item was added.
---
2. Add product to cart from product listing page
Preconditions:
- product listing page has Add to Cart button;
- product is active and available.
Steps:
- open category or search results page;
- click Add to Cart on product card;
- open cart.
Expected result:
- correct product is added;
- cart count updates;
- price matches product card;
- quantity is 1;
- user receives clear feedback;
- no wrong product is added.
---
3. Add product that requires variant selection
Preconditions:
- product has required variants, such as size or color;
- no variant is selected by default.
Steps:
- open product page;
- click Add to Cart without selecting variant.
Expected result:
- product is not added;
- user sees clear message asking to select required variant;
- cart count does not change;
- no incomplete item appears in cart.
---
4. Add product with selected variant
Preconditions:
- product has variants;
- at least one variant is available.
Steps:
- open product page;
- select size;
- select color;
- click Add to Cart;
- open cart.
Expected result:
- product appears in cart;
- selected size is displayed;
- selected color is displayed;
- correct SKU or variant is stored;
- correct variant price is shown;
- selected variant is passed to checkout.
---
5. Add same product with same variant twice
Preconditions:
- product allows quantity greater than 1;
- selected variant is available.
Steps:
- add product variant to cart;
- add the same product variant again;
- open cart.
Expected result:
- behavior matches product rules;
- either quantity increases to 2, or duplicate line appears if that is expected;
- cart count is correct;
- subtotal is recalculated;
- no unexpected duplicate appears.
---
6. Add same product with different variants
Preconditions:
- product has at least two variants;
- both variants are available.
Steps:
- add Size M / Black to cart;
- add Size L / Black to cart;
- open cart.
Expected result:
- variants appear as separate cart items;
- each item displays correct variant;
- each item has correct quantity;
- subtotal is correct;
- checkout receives both variants correctly.
---
7. Add multiple different products to cart
Preconditions:
- at least two active products are available.
Steps:
- add Product A to cart;
- add Product B to cart;
- open cart.
Expected result:
- both products appear in cart;
- product names are correct;
- prices are correct;
- quantities are correct;
- cart count is correct;
- subtotal equals sum of item totals.
---
8. Add discounted product to cart
Preconditions:
- product has active sale price or discount.
Steps:
- open discounted product page;
- add product to cart;
- open cart.
Expected result:
- sale price is displayed correctly;
- original price is shown if product design requires it;
- discount is reflected in item total;
- subtotal uses discounted price;
- cart price matches product page.
---
9. Add out-of-stock product to cart
Preconditions:
- product is out of stock.
Steps:
- open product page;
- try to click Add to Cart.
Expected result:
- product cannot be added;
- Add to Cart button is disabled or blocked;
- user sees clear out-of-stock message;
- cart count does not change;
- no unavailable item appears in cart.
---
10. Add low-stock product to cart
Preconditions:
- product has limited stock, for example 2 units available.
Steps:
- open product page;
- add product to cart;
- increase quantity beyond available stock.
Expected result:
- user can add available quantity;
- quantity cannot exceed stock;
- user sees clear stock message;
- subtotal is calculated only for allowed quantity;
- checkout does not receive unavailable quantity.
---
11. Increase item quantity in cart
Preconditions:
- product is in cart with quantity 1;
- product allows higher quantity.
Steps:
- open cart;
- increase quantity to 2 or 3.
Expected result:
- quantity updates;
- item total updates;
- cart subtotal updates;
- cart count updates according to product rule;
- updated quantity remains after refresh;
- checkout receives updated quantity.
---
12. Decrease item quantity in cart
Preconditions:
- product is in cart with quantity greater than 1.
Steps:
- open cart;
- decrease quantity.
Expected result:
- quantity decreases;
- item total recalculates;
- subtotal recalculates;
- cart count updates;
- quantity does not go below minimum;
- no negative quantity appears.
---
13. Set quantity to zero
Preconditions:
- product is in cart.
Steps:
- set quantity to 0, if manual input is allowed.
Expected result:
- behavior follows product rules;
- either item is removed, or validation error appears;
- cart does not show invalid quantity;
- subtotal remains correct;
- checkout does not receive quantity 0.
---
14. Enter invalid quantity
Preconditions:
- cart allows manual quantity input.
Steps:
- enter letters;
- enter decimal value;
- enter negative value;
- enter very large number.
Expected result:
- invalid values are rejected;
- user sees clear validation message;
- previous valid quantity is preserved or reset according to rules;
- subtotal does not become incorrect;
- no server error appears.
---
15. Remove one item from cart
Preconditions:
- cart contains at least two items.
Steps:
- open cart;
- remove one item.
Expected result:
- selected item is removed;
- other items remain;
- cart count updates;
- subtotal updates;
- removed item is not passed to checkout.
---
16. Remove last item from cart
Preconditions:
- cart contains one item.
Steps:
- open cart;
- remove the item.
Expected result:
- cart becomes empty;
- empty cart state appears;
- checkout button is hidden or disabled;
- cart count becomes zero;
- continue shopping CTA is available if expected.
---
17. Undo removed item, if supported
Preconditions:
- cart supports undo after remove;
- cart contains one or more items.
Steps:
- remove item;
- click Undo.
Expected result:
- removed item returns to cart;
- variant is preserved;
- quantity is preserved;
- subtotal is restored;
- cart count is restored.
---
18. Check empty cart page
Preconditions:
- cart is empty.
Steps:
- open cart page.
Expected result:
- empty cart message is displayed;
- page does not look broken;
- checkout action is unavailable;
- continue shopping action works;
- recommended products appear only if expected.
---
19. Check empty cart drawer
Preconditions:
- cart is empty;
- site uses cart drawer or mini cart.
Steps:
- click cart icon.
Expected result:
- drawer opens;
- empty cart state is shown;
- cart count is zero;
- user can close drawer;
- no broken layout appears.
---
20. Refresh page after adding item
Preconditions:
- item is in cart.
Steps:
- refresh page;
- open cart.
Expected result:
- cart still contains item;
- product data is correct;
- variant is preserved;
- quantity is preserved;
- subtotal is correct;
- no duplicate item appears.
---
21. Navigate away and return to cart
Preconditions:
- item is in cart.
Steps:
- add item to cart;
- open another page;
- return to cart.
Expected result:
- cart state is preserved;
- cart count remains correct;
- no item is lost;
- no duplicate item appears.
---
22. Close and reopen browser session, if cart persistence is expected
Preconditions:
- cart persistence across sessions is supported.
Steps:
- add item to cart;
- close browser;
- reopen browser;
- return to site;
- open cart.
Expected result:
- cart is restored according to product rules;
- product, variant, quantity, and subtotal are correct;
- expired cart behavior is handled if cart should not persist.
---
23. Add item as guest user
Preconditions:
- user is not logged in;
- guest cart is supported.
Steps:
- add product to cart;
- open cart.
Expected result:
- guest cart works;
- item appears in cart;
- cart persists during navigation;
- user is not forced to log in before cart if guest cart is allowed.
---
24. Proceed to checkout as guest user
Preconditions:
- guest checkout is supported;
- guest cart contains item.
Steps:
- open cart;
- click Proceed to Checkout.
Expected result:
- checkout opens;
- cart data is passed correctly;
- product, variant, quantity, and subtotal match cart;
- guest user can continue according to product rules.
---
25. Guest user sees login/signup prompt when account is required
Preconditions:
- guest checkout is not supported;
- guest cart contains item.
Steps:
- open cart;
- click Proceed to Checkout.
Expected result:
- user sees login/signup prompt;
- cart is not lost;
- after login/signup, cart behavior follows product rules.
---
26. Logged-in user adds item to cart
Preconditions:
- user is logged in;
- product is available.
Steps:
- add product to cart;
- open cart.
Expected result:
- item appears in logged-in cart;
- cart is linked to correct user;
- no other user can see this cart;
- cart persists according to product rules.
---
27. Logged-in cart persists after logout and login
Preconditions:
- logged-in cart persistence is supported.
Steps:
- log in;
- add product to cart;
- log out;
- log in again;
- open cart.
Expected result:
- cart is restored;
- product, variant, quantity, and subtotal are correct;
- cart belongs to the correct account.
---
28. Guest cart merges after login
Preconditions:
- guest cart exists;
- user account has empty or existing cart;
- cart merge is supported.
Steps:
- as guest, add item to cart;
- log in;
- open cart.
Expected result:
- guest cart is preserved or merged according to rules;
- no items are lost;
- no unexpected duplicates appear;
- quantities are correct;
- variants are correct.
---
29. Guest cart and existing account cart merge
Preconditions:
- guest cart contains Product A;
- account cart already contains Product B.
Steps:
- as guest, add Product A;
- log in to account with Product B in cart;
- open cart.
Expected result:
- cart contains Product A and Product B;
- quantities are correct;
- variants are correct;
- subtotal is correct;
- no item from another user appears.
---
30. Same product merge after login
Preconditions:
- guest cart contains Product A quantity 1;
- account cart contains same Product A quantity 1.
Steps:
- log in after creating guest cart.
Expected result:
- behavior matches product rules;
- quantity becomes 2 if merge-by-quantity is expected;
- or duplicate lines are handled according to rules;
- subtotal is correct.
---
31. Add item in one browser tab and check another tab
Preconditions:
- user has site open in two tabs.
Steps:
- add item to cart in Tab A;
- open cart in Tab B.
Expected result:
- cart state is synchronized or stale state is handled clearly;
- user does not see misleading cart data;
- checkout does not use outdated cart without warning.
---
32. Update quantity in one tab and checkout in another
Preconditions:
- cart contains item;
- site is open in two tabs.
Steps:
- update quantity in Tab A;
- attempt checkout from Tab B.
Expected result:
- checkout uses correct latest quantity or shows refresh/update message;
- no stale or conflicting order is created.
---
33. Apply valid promo code in cart
Preconditions:
- cart contains eligible item;
- valid promo code exists.
Steps:
- open cart;
- enter promo code;
- apply code.
Expected result:
- promo code is applied;
- discount is displayed;
- subtotal/total preview recalculates;
- discount is passed to checkout;
- user sees clear success message.
---
34. Apply invalid promo code
Preconditions:
- cart contains item.
Steps:
- enter invalid promo code;
- apply code.
Expected result:
- promo code is rejected;
- user sees clear error;
- totals do not change incorrectly;
- cart state remains stable.
---
35. Apply expired promo code
Preconditions:
- expired promo code exists.
Steps:
- enter expired promo code;
- apply code.
Expected result:
- code is rejected;
- user sees clear message;
- no discount is applied;
- cart total remains correct.
---
36. Remove promo code
Preconditions:
- valid promo code is applied.
Steps:
- remove promo code.
Expected result:
- discount is removed;
- subtotal/total recalculates;
- cart returns to correct non-discounted state;
- checkout no longer receives removed promo code.
---
37. Promo code applies only to eligible items
Preconditions:
- cart contains eligible and non-eligible products;
- promo code applies only to eligible product.
Steps:
- apply promo code.
Expected result:
- discount applies only to eligible item;
- non-eligible item price remains unchanged;
- subtotal is correct;
- discount explanation is clear.
---
38. Free shipping discount in cart
Preconditions:
- promo code or cart rule gives free shipping.
Steps:
- add eligible item;
- apply free-shipping discount if needed;
- review cart summary.
Expected result:
- shipping preview reflects free shipping if cart supports it;
- discount is clear;
- checkout receives correct shipping discount.
---
39. Free shipping threshold message
Preconditions:
- product supports free shipping threshold message.
Steps:
- add item below threshold;
- check cart message;
- increase quantity or add item to reach threshold.
Expected result:
- message shows correct remaining amount;
- once threshold is reached, message updates;
- totals remain correct.
---
40. Check subtotal without discount
Preconditions:
- cart contains one or more products without discounts.
Steps:
- open cart;
- calculate expected subtotal manually.
Expected result:
- subtotal equals sum of item totals;
- quantity is included;
- currency is correct;
- rounding is correct.
---
41. Check subtotal with multiple quantities
Preconditions:
- cart contains product with quantity greater than 1.
Steps:
- open cart;
- verify item total and subtotal.
Expected result:
- unit price × quantity is correct;
- subtotal is correct;
- no rounding issue appears.
---
42. Check currency display in cart
Preconditions:
- product uses specific currency.
Steps:
- add product to cart;
- open cart.
Expected result:
- currency symbol/code is correct;
- price format is correct;
- cart currency matches product page and checkout.
---
43. Check tax or shipping estimate in cart, if shown
Preconditions:
- cart displays tax or shipping estimate.
Steps:
- add product to cart;
- review cart summary.
Expected result:
- estimate is displayed correctly;
- user understands it is an estimate if final value is calculated in checkout;
- estimate does not contradict checkout.
---
44. Proceed to checkout with one product
Preconditions:
- cart contains one item.
Steps:
- open cart;
- click Proceed to Checkout.
Expected result:
- checkout opens;
- checkout receives correct product;
- selected variant is correct;
- quantity is correct;
- price and subtotal are correct.
---
45. Proceed to checkout with multiple products
Preconditions:
- cart contains multiple items.
Steps:
- open cart;
- proceed to checkout.
Expected result:
- all items are passed to checkout;
- variants are correct;
- quantities are correct;
- subtotal is correct;
- no item is missing.
---
46. Attempt checkout with empty cart
Preconditions:
- cart is empty.
Steps:
- open cart;
- try to proceed to checkout.
Expected result:
- checkout is blocked;
- user sees empty cart state;
- no empty order is created.
---
47. Attempt checkout with unavailable item
Preconditions:
- item was added to cart while available;
- item later becomes unavailable.
Steps:
- open cart;
- try to proceed to checkout.
Expected result:
- user sees clear availability warning;
- checkout is blocked or item is removed according to rules;
- unavailable item is not purchased silently.
---
48. Price changes after item was added to cart
Preconditions:
- item is in cart;
- product price changes before checkout.
Steps:
- open cart after price change.
Expected result:
- cart follows product rules;
- either old price is preserved or new price is shown with clear message;
- checkout receives correct price;
- user is not misled.
---
49. Item becomes out of stock after being added
Preconditions:
- item was added while in stock;
- item becomes out of stock.
Steps:
- reopen cart.
Expected result:
- cart shows out-of-stock state;
- user cannot complete purchase without resolving issue;
- subtotal updates if item is removed;
- message is clear.
---
50. Item is unpublished after being added to cart
Preconditions:
- product was added to cart;
- product is later unpublished or hidden.
Steps:
- reopen cart.
Expected result:
- product is handled according to rules;
- user sees clear message;
- hidden product cannot be purchased if no longer allowed;
- cart does not break.
---
51. Double-click Add to Cart
Preconditions:
- product page is open;
- product is available.
Steps:
- double-click Add to Cart quickly.
Expected result:
- no unexpected duplicate item is created;
- quantity behavior follows product rules;
- button loading/disabled state prevents accidental repeated actions if needed.
---
52. Click Add to Cart repeatedly during slow network
Preconditions:
- slow network can be simulated;
- product is available.
Steps:
- click Add to Cart several times before response returns.
Expected result:
- system handles repeated requests safely;
- no unexpected duplicates appear;
- user receives clear feedback;
- cart remains consistent.
---
53. Refresh after Add to Cart request
Preconditions:
- product page is open;
- add to cart request is in progress.
Steps:
- click Add to Cart;
- refresh page before request completes.
Expected result:
- cart state remains consistent;
- item is either added once or not added with clear behavior;
- no duplicate item appears;
- no broken cart state appears.
---
54. Network error during Add to Cart
Preconditions:
- network error can be simulated.
Steps:
- click Add to Cart while network fails.
Expected result:
- user sees clear error;
- cart count does not show false success;
- user can retry;
- no duplicate item appears after retry.
---
55. Network error during quantity update
Preconditions:
- product is in cart;
- network error can be simulated.
Steps:
- update quantity while network fails.
Expected result:
- user sees clear error;
- previous quantity is preserved or sync state is clear;
- subtotal remains correct;
- user can retry.
---
56. Network error during remove item
Preconditions:
- product is in cart;
- network error can be simulated.
Steps:
- remove item while network fails.
Expected result:
- user sees clear error;
- item state is not misleading;
- cart recovers after retry or refresh;
- backend and UI stay consistent.
---
57. Cart drawer opens after Add to Cart
Preconditions:
- product page uses cart drawer behavior.
Steps:
- add product to cart.
Expected result:
- cart drawer opens;
- added item appears;
- product details are correct;
- user can continue shopping;
- user can proceed to checkout;
- user can close drawer.
---
58. Cart drawer with many items
Preconditions:
- cart contains many items.
Steps:
- open cart drawer.
Expected result:
- drawer is scrollable;
- all items are accessible;
- subtotal is visible or reachable;
- checkout CTA is accessible;
- drawer does not break layout.
---
59. Cart page with many items
Preconditions:
- cart contains many items.
Steps:
- open cart page.
Expected result:
- all items are displayed or paginated according to product rules;
- page performance is acceptable;
- quantity and remove actions work;
- subtotal is correct;
- page remains usable on mobile.
---
60. Long product name in cart
Preconditions:
- product has long title.
Steps:
- add product to cart;
- open cart.
Expected result:
- product name is readable;
- layout is not broken;
- important actions remain visible;
- mobile layout remains usable.
---
61. Product without image in cart
Preconditions:
- product has no image or image fails to load.
Steps:
- add product to cart.
Expected result:
- fallback image or placeholder appears;
- layout is not broken;
- product remains identifiable.
---
62. Cart on mobile device
Preconditions:
- real or emulated mobile device is available.
Steps:
- add product to cart;
- open cart;
- update quantity;
- remove item;
- proceed to checkout.
Expected result:
- cart is usable on mobile;
- product details are readable;
- controls are easy to tap;
- no horizontal scroll appears;
- checkout CTA is visible.
---
63. Mobile cart with keyboard interaction
Preconditions:
- cart allows manual quantity or promo code input.
Steps:
- open cart on mobile;
- tap quantity or promo code field.
Expected result:
- correct keyboard opens;
- keyboard does not cover active field or apply button;
- user can submit input;
- layout remains usable.
---
64. Cart in Safari
Preconditions:
- Safari browser is available.
Steps:
- add item to cart;
- refresh;
- update quantity;
- proceed to checkout.
Expected result:
- cart works correctly in Safari;
- persistence works;
- no browser-specific layout or storage issue appears.
---
65. Cart in Chrome
Preconditions:
- Chrome browser is available.
Steps:
- add item to cart;
- refresh;
- update quantity;
- proceed to checkout.
Expected result:
- cart works correctly in Chrome;
- cart behavior matches expected product rules.
---
66. Cart with browser Back
Preconditions:
- item is in cart;
- user navigates between product page, cart, and checkout.
Steps:
- go from cart to checkout;
- click browser Back.
Expected result:
- cart state is preserved;
- user does not see stale or broken cart;
- no duplicate action occurs.
---
67. Cart after checkout completion
Preconditions:
- user completes an order successfully.
Steps:
- complete checkout;
- return to cart.
Expected result:
- cart is cleared if product rules say so;
- order items are not still active in cart;
- user does not accidentally order same cart again.
---
68. Cart after failed checkout
Preconditions:
- checkout can fail safely.
Steps:
- proceed to checkout;
- trigger failed checkout or failed payment;
- return to cart.
Expected result:
- cart is preserved if order was not completed;
- user can retry;
- item data remains correct;
- no duplicate order is created.
---
69. Cart after canceled payment
Preconditions:
- payment provider supports cancel flow.
Steps:
- proceed to checkout/payment;
- cancel payment;
- return to cart.
Expected result:
- cart is preserved or restored according to product rules;
- user can retry payment;
- no completed order is created.
---
70. Cart analytics: Add to Cart event
Preconditions:
- analytics tracking is enabled.
Steps:
- add product to cart.
Expected result:
add_to_cartevent is sent;- product ID is correct;
- variant ID is correct if applicable;
- price is correct;
- quantity is correct;
- currency is correct;
- event is not duplicated.
---
71. Cart analytics: Remove from Cart event
Preconditions:
- analytics tracking is enabled;
- item is in cart.
Steps:
- remove item from cart.
Expected result:
remove_from_cartevent is sent;- product data is correct;
- quantity is correct;
- event is not duplicated.
---
72. Cart analytics: Begin Checkout event
Preconditions:
- analytics tracking is enabled;
- cart contains item.
Steps:
- click Proceed to Checkout.
Expected result:
begin_checkoutevent is sent;- cart items are correct;
- value is correct;
- currency is correct;
- coupon is passed if applied;
- event is not duplicated.
---
73. Cart API returns correct cart
Preconditions:
- cart API is used.
Steps:
- add product to cart;
- call get cart endpoint.
Expected result:
- API returns correct cart ID;
- items are correct;
- variant is correct;
- quantity is correct;
- subtotal is correct;
- cart belongs to correct user/session.
---
74. Cart API rejects invalid product
Preconditions:
- cart API is available.
Steps:
- send add to cart request with invalid product ID.
Expected result:
- request is rejected;
- status code follows API rules;
- no cart item is created;
- error response is clear.
---
75. Cart API rejects unavailable variant
Preconditions:
- unavailable variant exists.
Steps:
- send add to cart request for unavailable variant.
Expected result:
- request is rejected;
- cart does not include unavailable variant;
- backend enforces restriction, not only frontend.
---
76. User cannot access another user’s cart
Preconditions:
- User A has cart;
- User B exists.
Steps:
- try to open or request User A’s cart as User B.
Expected result:
- access is denied;
- User B does not see User A’s cart data;
- no sensitive cart information is exposed.
---
77. Price cannot be changed from frontend
Preconditions:
- cart API can be inspected.
Steps:
- attempt to modify price in frontend request.
Expected result:
- backend ignores or rejects client-side price manipulation;
- cart uses server-side price;
- subtotal remains correct.
---
78. Quantity limit is enforced on backend
Preconditions:
- product has quantity limit.
Steps:
- attempt to set quantity above limit through direct request.
Expected result:
- backend rejects invalid quantity;
- cart remains valid;
- frontend cannot bypass limit.
---
79. Promo restriction is enforced on backend
Preconditions:
- promo code has restrictions.
Steps:
- attempt to apply promo code to non-eligible product.
Expected result:
- backend rejects or ignores invalid promo application;
- discount is not applied;
- cart totals remain correct.
---
80. Production cart smoke test
Preconditions:
- production release is deployed;
- safe product/test path is agreed.
Steps:
- open production product page;
- add product to cart;
- open cart;
- update quantity;
- remove item or proceed to checkout safely;
- verify analytics/logs if needed.
Expected result:
- production cart works;
- no staging data appears;
- cart totals are correct;
- checkout receives correct cart data;
- no critical console/API errors appear;
- no duplicate item or order is created.
---
Best test data for shopping cart test cases
To make shopping cart test cases useful, prepare test data in advance.
Use:
- regular product;
- product with variants;
- discounted product;
- product with long name;
- product with image;
- product without image;
- out-of-stock product;
- low-stock product;
- product with quantity limit;
- product excluded from promo code;
- digital product;
- physical product;
- bundle;
- subscription plan, if relevant;
- guest user;
- logged-in user;
- user with existing cart;
- valid promo code;
- invalid promo code;
- expired promo code.
Good test data makes cart testing much faster and much more reliable.
---
Automation candidates for shopping cart test cases
Not every cart test case should be automated, but many are good candidates.
Good automation candidates:
- add one product to cart;
- add product with variant;
- update quantity;
- remove item;
- empty cart state;
- cart persistence after refresh;
- guest cart;
- logged-in cart;
- cart merge after login;
- valid promo code;
- invalid promo code;
- out-of-stock item;
- cart-to-checkout transition;
add_to_cartanalytics event;- duplicate prevention after double click;
- backend cart API checks.
Keep some scenarios manual:
- mobile usability;
- visual layout;
- cart drawer behavior with long content;
- exploratory duplicate-action testing;
- browser-specific issues;
- production smoke.
A good cart automation suite should be stable, fast, and focused on high-risk flows.
---
Common mistakes
1. Writing only broad checks instead of test cases
“Check cart” is not a test case. A real test case needs preconditions, steps, and expected result.
2. Testing only Add to Cart
Add to Cart is important, but cart testing also needs variants, quantity, remove, subtotal, persistence, guest cart, login merge, stock, discounts, mobile, and checkout handoff.
3. Not testing variants
Wrong variant in cart is a critical issue. Size, color, plan, SKU, and price should be verified.
4. Not testing guest cart
Many users add products before login. Guest cart issues directly affect conversion.
5. Not testing cart merge after login
Guest cart + account cart can create lost items, wrong quantity, or duplicates.
6. Not testing stock changes
A product can become out of stock after it was added to cart. Cart should handle this clearly.
7. Not testing duplicate actions
Double click, retry, slow network, refresh, and multiple tabs can create duplicate items or wrong subtotals.
8. Not checking checkout handoff
A cart can look correct but pass wrong product, variant, quantity, discount, or subtotal to checkout.
9. Not testing mobile cart
Cart can work on desktop but fail on mobile because of small controls, hidden CTA, keyboard, drawer, or horizontal scroll.
10. Not verifying backend rules
Price, quantity limit, promo eligibility, ownership, and stock must be enforced on the backend, not only in UI.
---
FAQ
What are shopping cart test cases?
Shopping cart test cases are specific test scenarios used to verify cart behavior.
They usually cover add to cart, product variants, quantity, remove item, subtotal, discounts, cart persistence, guest cart, logged-in cart, cart merge, stock handling, mobile cart, checkout transition, analytics, and backend validation.
How do you write test cases for a shopping cart?
A good shopping cart test case should include:
- test case title;
- preconditions;
- test steps;
- expected result;
- test data;
- priority or severity, if needed.
For example: add product to cart, verify item name, selected variant, quantity, price, subtotal, and cart count.
What are the most important cart test cases?
The most important cart test cases are:
- add product to cart;
- add product with variant;
- update quantity;
- remove item;
- empty cart;
- cart persistence after refresh;
- guest cart;
- cart merge after login;
- promo code;
- out-of-stock item;
- proceed to checkout;
- mobile cart;
- duplicate prevention.
How do you test Add to Cart?
To test Add to Cart:
- open product page;
- select required variant;
- click Add to Cart;
- open cart;
- verify product name, variant, quantity, price, cart count, and subtotal.
Also check double click, slow network, unavailable product, and analytics event.
How do you test product variants in cart?
Add products with different variants and verify that size, color, SKU, image, price, and quantity are correct in cart and passed correctly to checkout.
Same product with different variants should usually appear as separate cart lines unless product rules say otherwise.
How do you test cart quantity?
Check increasing quantity, decreasing quantity, invalid values, quantity limits, stock limits, subtotal recalculation, persistence after refresh, and correct quantity in checkout.
How do you test guest cart?
As a guest user, add products to cart, navigate around the site, refresh the page, proceed to checkout, and log in if needed.
Expected result: cart should not be lost unexpectedly, and guest-to-login behavior should follow product rules.
How do you test cart merge after login?
Create a guest cart, then log in to an account that may already have items.
Expected result: cart should merge according to product rules, with no lost items, no unexpected duplicates, correct variants, correct quantity, and correct subtotal.
How do you test promo code in cart?
Use valid, invalid, expired, and restricted promo codes.
Verify discount amount, eligible items, subtotal recalculation, error messages, removing promo code, and whether the discount is passed to checkout.
How do you test out-of-stock items in cart?
Check that out-of-stock products cannot be added, and items that become unavailable after being added show a clear warning.
Checkout should be blocked or the item should be removed according to product rules.
Should shopping cart test cases be automated?
Many shopping cart test cases are good automation candidates, especially add to cart, update quantity, remove item, cart persistence, promo code, guest cart, cart merge, and checkout handoff.
Manual testing is still useful for mobile usability, visual states, browser-specific bugs, and exploratory duplicate-action scenarios.
How do you know shopping cart test cases passed?
Shopping cart test cases can be considered passed when:
- products can be added correctly;
- variants are preserved;
- quantity works;
- remove works;
- totals are correct;
- discounts work;
- cart persists according to rules;
- guest and logged-in carts work;
- cart merge works if supported;
- stock issues are handled;
- checkout receives correct cart data;
- mobile cart works;
- backend rules are enforced;
- no blocker or critical cart bugs remain.