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

124 lines
12 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, placing real orders, sending notifications, deleting data, or applying migrations.
Inventory: **45 feature checklists and 855 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. Checkout is COD-only; online payment is not part of this release.
## 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 required by the current add/edit UI; legacy API-created rows may omit them and fall back to the region's effective bound. |
| 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; no online-payment or refund fixtures. |
| 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) |
| Support | [Complaints](complaints.md), [Customer operations/incidents](customer-management-incidents.md), [Notifications](notifications.md) **(EXCLUDED from automated run — see below)** |
| Infrastructure | [Uploads](uploads-images.md), [Cache publication](cache-publication.md), [Jobs/health](jobs-health.md) **(queue/scheduler cases EXCLUDED — see below)**, [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) **(EXCLUDED — see below)** |
| Approval-required provider integration | [OTP authentication](otp-authentication.md) (isolated provider sandbox only; excluded from default password regression) |
| Excluded from automated regression | [Notifications/push](notifications.md) (**skipped by owner instruction** for the 2026-10-18 run; cases retained, marked `SKIPPED`, never `PASS`/`FAIL`) |
## Excluded checklists
The following checklists are **not** executed by the automated harness and their cases are reported as `SKIPPED`
(not `PASS`/`FAIL`/`NOT RUN`):
- [OTP authentication](otp-authentication.md) — needs an isolated SMS/OTP provider sandbox; excluded from the default password suite.
- [Notifications / push](notifications.md) — needs real push delivery to devices/recipients; **excluded by owner instruction** (2026-10-18). The cases are retained verbatim so they can be run manually in an isolated provider sandbox when explicitly authorised.
- Queue / scheduled-job cases in [Jobs/health](jobs-health.md) (`JOB-03`–`JOB-10`, `JOB-12`–`JOB-15`) — **excluded by owner instruction** (2026-10-18); no scheduler/queue harness is exercised automatically. The health/startup cases `JOB-01`, `JOB-02`, `JOB-11` remain in scope.
- [Fallback/legacy standalone pages](fallback-legacy-pages.md) (`LEGACY-01`–`LEGACY-14`) — **excluded by owner instruction** (2026-10-18); `apps/fallback-ui` is out of scope for this release cycle and is not started.
`SKIPPED` is neither a pass nor a failure and must not be counted as coverage.
## Policy checkpoints
- Discounts round to the nearest rupee; per-sub-order shares allocate whole rupees and reconcile exactly to the charged discount.
- Coupons stack sequentially on the remaining eligible amount, in the customer's selection order. Each coupon's cap applies to its own reduced base; reversing the order can change the result.
- 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.
- **Native** never persists the browsing region: each launch re-derives it from the device location and/or the default address (see [location and switching](location-region-switching.md)). **Web** persists the selected region in `freshyo-region` and validates it against `listRegions`.
- 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 |
|---|---|
| Customer search bypasses regional isolation | CUSTOMER-17 |
| Web discovery input mismatch | CFG-01, CAT-01, CACHE-01 |
| Global SKU ID stripped on edit | GP-03, GP-04 |
| Rejected regional edit deletes global store image | GSTORE-15 |
| Regional cache request narrows a global regeneration | CACHE-23, JOB-15 |
| Web scheduled checkout submits null slot IDs | CHECK-22 |
| New-region cache generation detached from request | REGION-16 |
| Global-product create/edit draft bleed | GP-21 |
| Quiet-region orders hidden by global ID window | ORDER-21 |
| Startup region adoption clears persisted cart | CART-11, LOC-09, LOC-21 |
| Unrelated market edit clears regional suspension | STOCK-07, STOCK-08 |
| Overlapping coupons/negative sub-orders | CPA-14, MONEY-12, CSQ-06, CSQ-11 |
| Uncapped mobile preview | CPA-15, MONEY-13 |
| Historical discount backfilled as zero | ORDER-22 (accepted limitation) |
| Global coupon type switch keeps old discount | CPM-21 |
| Admin-web reload loses staff identity/region | SAUTH-15 |
| Superadmin admin notification uses staff-only endpoint | PUSH-19 |
| Customer can reach admin protected procedures | SEC-28 |
| 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, CUSTOMER-17, GP-03, GP-21, STOCK-03, STOCK-07, SLOT-01, CART-01, ADDR-01, CHECK-01, CHECK-22, MONEY-01, CPA-01, CPA-07, CPA-14, ORDER-01, FUL-01, CANCEL-01, SEC-01, SEC-28, CACHE-01, CACHE-23, REGION-16. Then execute all P0 cases before release and the remaining applicable cases in the full regression run.