freshyo/docs/test-cases/cart.md
2026-10-13 19:10:27 +05:30

31 lines
3.8 KiB
Markdown

# Regular and flash carts
Scope: local cart storage, query hooks, quantity/slot reconciliation, floating/expanded/full cart, notes and region switching. Fixtures: P/Q/G and independent regular/flash carts.
| ID | Priority | Action / input | Expected result |
|---|---|---|---|
| CART-01 | P0 | Add from Home/search/store/detail; inspect all cart surfaces. | Same SKU IDs, quantities, line counts, prices and subtotal. |
| CART-02 | P1 | Add same SKU again vs explicit Update Item. | Add merges as intended; update sets quantity, not adds again. |
| CART-03 | P1 | Increase/decrease with product increment step. | Same allowed quantity rule in every entry point. |
| CART-04 | P1 | Zero/remove confirmation cancel then confirm. | Cancel retains line; confirm removes only selected SKU. |
| CART-05 | P0 | Populated cart, cold-start before catalog/availability loads. | Cart restored when stores ready; not silently deleted or permanently empty. |
| CART-06 | P1 | Regular/flash populated; edit/remove one. | Separate storage/state; no unintended other-cart changes. |
| CART-07 | P1 | Assign/change slots; leave/reenter/relaunch. | Selection persistence matches policy; no quantity duplication. |
| CART-08 | P0 | One line becomes OOS/suspended/deleted; all lines invalid. | Clearly excluded from pricing/submit; all-invalid checkout blocked. |
| CART-09 | P1 | Notes entered, navigate checkout/back, edit again. | Latest notes survive and are submitted; readonly checkout agrees. |
| CART-10 | P1 | Apply/remove several coupons, quantity changes. | Eligibility/discount recomputed; no stale invalid selected discount. |
| CART-11 | P0 | Confirm A→B switch (from an already-set region); cancel switch. | Confirm clears regional state/both carts; cancel preserves everything. First region adoption at cold start is not this path and does not clear. |
| CART-12 | P1 | Two rapid adds/different SKU writes and concurrent controls. | No lost storage update or duplicate local ID/negative quantity. |
| CART-13 | P1 | Corrupt JSON/storage unavailable/full. | Recoverable state; never order corrupted/unknown quantity. |
| CART-14 | P1 | Catalog ID missing after product deletion or region switch. | Useful missing-line state; no zero-priced purchasable phantom. |
| CART-15 | P1 | Slow price refresh while cart visible. | Coherent quote/loading; no mixture of previous region's prices. |
| CART-16 | P1 | Large quantities/fractional increments direct local/API input. | Contract enforced; integer order quantities not silently rounded. |
| CART-17 | P1 | Logout/login U2 with U1 cart. | Agreed cart-retention policy; no U1 address/coupon/notes ownership leakage. |
| CART-18 | P1 | Checkout only selected available subset, then success. | Ordered lines cleared per agreed policy; unrelated invalid/unselected lines not silently lost. |
| CART-19 | P2 | Floating bar expand/collapse, navigation, safe-area/keyboard. | Counts accurate; cart usable across platforms. |
| CART-20 | P1 | Back from checkout with malformed/stale slot/coupon params. | Existing cart unchanged; explicit reconciliation instead of wrong item ordered. |
| CART-21 | P0 | Network unavailable; attempt submit from cached cart. | No false order success; recoverable offline state. |
| CART-22 | P1 | Same global SKU across A/B switch. | Old A quote/slot does not survive because structural ID is shared. |
| CART-23 | P0 | Signed-in customer with zero addresses opens the cart, populated and empty. | Add-address gate shows before the cart, even when empty; the first saved address becomes the default, then the cart renders. |
Policy checkpoints: local cart behavior on account switch, first region adoption must preserve the cart (only an explicit switch clears it), slot persistence, fractional increment support, and retention of invalid lines after partial checkout.