freshyo/docs/test-cases/README.md
2026-10-15 20:31:20 +05:30

98 lines
9.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Feature test-case catalog
## Purpose and status
This folder contains feature-by-feature acceptance and regression checklists for Freshyo's customer mobile/web apps, regional admin mobile/web apps, superadmin web app, backend, cache/jobs, and legacy fallback surfaces.
**All cases are proposed and NOT RUN.** A listed expected result is a requirement to verify, not a claim that the implementation currently satisfies it. Known review defects are intentionally covered. Documentation creation does not authorize running tests, sending notifications, charging payments, deleting data, or applying migrations.
Inventory: **46 feature checklists and 862 uniquely identified cases**, plus this index. Features are grouped by business responsibility; closely related operations share a checklist (for example stock, offer flags and suspension). Reuse the shared boundary/security matrix rather than assuming a finite list can cover every possible input.
Sources: current routers/screens/helpers, existing API tests, [sanity plan](../e2e-sanity-test-plan.md), and [branch review](../multi-region-i2-review.md). Older sanity-plan statements that coupons ignore regions/SKUs are superseded here by the newer coupon requirements. Vendor snippets and reviews remain conditional/legacy coverage; online gateway cases are readiness coverage until implementation is enabled.
## How to use each checklist
- Each case has a stable ID, priority, concrete action/input, and observable expected result.
- **P0:** release-critical authorization, financial integrity, or core purchasing. **P1:** normal functional/edge regression. **P2:** resilience, presentation, compatibility, or conditional feature coverage. These are test priorities, not defect severities.
- Run happy paths through the UI; validate persistence and security through authoritative API/read-only database evidence. Component tests alone do not prove end-to-end behavior.
- Execute API checks even if a control is hidden in the UI. Repeat on every relevant client; web/native are separate implementations.
- Record `PASS`, `FAIL`, `BLOCKED`, `NOT RUN`, or `N/A` in a separate run report. `N/A` needs a reason; `BLOCKED` is not a pass. Do not check off cases solely because a toast appeared.
- For every rejected mutation, verify no partial row changes, sibling changes, image deletion, or unrelated-region writes.
- For every money case, compare cart, checkout, success, persisted order, customer detail, and admin detail: `goods − stored discount + delivery = payable` per sub-order and in aggregate. Delivery is charged once per checkout group; no negative/nonfinite monetary values.
- For cache cases, record authoritative value, region/bound, served version, and elapsed time. Use a bounded publication deadline (initial staging baseline: 120 seconds), not unbounded sleeps.
- Treat policy-dependent cases as `BLOCKED: POLICY` until agreed. Never infer a product decision from a current bug.
## Shared fixtures
Use isolated staging with dedicated DB/KV/assets/queues and sandbox recipients. Verify the actual API host before any mutation; do not use production credentials. Read secrets from approved environment configuration, never this documentation.
| Fixture | Required setup |
|---|---|
| Regions | A and B; A1/A2 bounds with priorities 1/2 and different fees; B1; valid interior, exterior, edge and overlap coordinates. |
| Identities | Anonymous, customers U1/U2, new customer U0, suspended disposable customer, regional admins A/B, supported staff roles, superadmin. |
| Products | A-only P with two SKUs, B-only Q, global G with independent A/B prices; regular-only R; flash F with a distinct price; combo C and combo-only component K. |
| Availability | Available, OOS, globally suspended, regionally suspended, soft-deleted variants; preserve a historical order referencing one. |
| Slots | Two valid A slots S1/S2, B slot, inactive/frozen/full/past slots, and midnight-boundary times. |
| Addresses | U1 in A1/A2/B1; U2-only address; default and sole-address fixtures; legacy address without a stored bound; a zero-address signed-in customer for the cart gate. Coordinates are mandatory. |
| Coupons | Regional A/B and global; percentage/flat; targeted/whole-cart; capped, min-spend, exclusive, first-order, limited-use, user-only, expired/invalidated, reserved. |
| Orders | Pending COD, packaged, verified, delivered, cancelled, multi-slot group; payment/refund fixtures only in approved sandbox. |
| Money | T = free threshold, D = fee; test T−0.01, T, T+0.01. Example goods: ₹100 targeted + ₹900 unrelated. Separate regular/flash values. |
| Content | Tags, groups, active/inactive banners, images, supported notification links, complaints and incident fixtures. |
Use unique run prefixes. Do not delete regions for cleanup: region deletion is unsupported. Never run migrations as test setup. Keep shared fixtures intact; clean only approved disposable data. Use time-relative slots/expiry dates with margins, except deliberate exact-boundary cases.
## Feature index
| Area | Checklist |
|---|---|
| Identity | [Customer authentication](customer-authentication.md), [Profile/account lifecycle](profile-account-lifecycle.md), [Staff authentication](staff-authentication.md), [Staff management](staff-management.md) |
| Geography | [Regions](regions.md), [Bounds](bounds.md), [Location and switching](location-region-switching.md), [Constants](constants-configuration.md) |
| Catalog administration | [Regional stores](regional-stores.md), [Global stores](global-stores.md), [Regional products](regional-products.md), [Global products/elevation](global-products.md), [Prices/stock/suspension](prices-stock-suspension.md), [Combos](combos.md) |
| Merchandising | [Catalog/search](catalog-search.md), [Tags/order](product-tags-ordering.md), [Groups](product-groups.md), [Banners](banners.md) |
| Purchasing | [Slots](scheduled-slots.md), [Cart](cart.md), [Addresses](addresses.md), [Checkout](checkout.md), [Pricing](pricing-delivery-fees.md), [Flash](flash-delivery.md) |
| Coupons | [Administration](coupon-management.md), [Eligibility/stacking](coupon-application.md), [Stacking & cart guards](coupon-stacking-and-cart-guards.md), [Reserved/cancellation coupons](reserved-coupons.md) |
| Order operations | [Placement/history](orders.md), [Fulfillment](fulfillment.md), [Cancellation](cancellation.md), [Edits/rebalance](order-edits-rebalance.md), [Delivery sequence/maps](delivery-operations.md), [Payment/refund readiness](payments-refunds.md) |
| Support | [Complaints](complaints.md), [Customer operations/incidents](customer-management-incidents.md), [Notifications](notifications.md) |
| Infrastructure | [Uploads](uploads-images.md), [Cache publication](cache-publication.md), [Jobs/health](jobs-health.md), [Security](authorization-api-contracts.md), [Recovery/platform/accessibility](recovery-platform-accessibility.md) |
| Conditional/legacy | [Vendor snippets](vendor-snippets.md), [Reviews](reviews.md), [Fallback/legacy pages](fallback-legacy-pages.md) |
| Approval-required provider integration | [OTP authentication](otp-authentication.md) (isolated provider sandbox only; excluded from default password regression) |
## Policy checkpoints
- Currency rounding and residual allocation: choose a consistent minor-unit policy; don't assert an invented rounding mode.
- Percentage stacking: confirm whether successive percentages use original or remaining eligible value. Regardless, targets, caps, nonnegative totals, and client/server agreement are mandatory.
- Global coupon targeting regional products: confirm intended authoring restrictions; never permit a regional author to attach another region's private SKU.
- Combo component availability, group-to-slot snapshot/live membership, global-name uniqueness/case normalization, and account-switch cart behavior need explicit decisions where not specified.
- No general minimum order value is required by the current policy. Coupon `minOrder` is independent from free-delivery thresholds.
- The browsing region is never persisted: each launch re-derives it from the device location and/or the default address (see [location and switching](location-region-switching.md)). Do not assert a "saved region" survives relaunch.
- UI duplicate-submit prevention is required. Server order-idempotency was previously deferred: record concurrent API behavior and ambiguous-retry exposure, not an assumed guaranteed deduplication.
- Define concurrency guarantees for capacity, default-address updates, limited coupons, and reserved redemption. Financial/one-time invariants must not silently be weakened to match observed races.
## Known-defect regression mapping
| Review issue | Cases |
|---|---|
| Web discovery input mismatch | CFG-01, CAT-01, CACHE-01 |
| Global SKU ID stripped on edit | GP-03, GP-04 |
| Overlapping coupons/negative sub-orders | CPA-14, MONEY-12 |
| Uncapped mobile preview | CPA-15, MONEY-13 |
| Regional suspension lost on reopen | STOCK-07, STOCK-08 |
| Global SKU rejected by bulk prices | STOCK-03, STOCK-04 |
| Targeted minOrder uses whole cart in UI | CPA-07, CPA-08 |
## Run-report template
```text
Run ID / date / code revision:
Environment / verified API host / client build:
Case ID / client / identity / region / bound:
Fixture IDs and relevant pre-state:
Actions and exact inputs:
Expected / actual:
Status and reason:
API status/body, persisted values, versions, timestamps:
Screenshot/log links (redacted):
Cleanup / retained evidence / linked defect:
```
Recommended first pass: AUTH-01, CFG-01, LOC-19, GP-03, STOCK-03, STOCK-07, SLOT-01, CART-01, ADDR-01, CHECK-01, MONEY-01, CPA-01, CPA-07, CPA-14, ORDER-01, FUL-01, CANCEL-01, SEC-01, CACHE-01. Then execute all P0 cases before release and the remaining applicable cases in the full regression run.