53 lines
2.5 KiB
Markdown
53 lines
2.5 KiB
Markdown
# Region E2E tests (Maestro)
|
|
|
|
Region/location flows for the **user-ui** app (`com.freshyotrial.app`) and the
|
|
**admin-ui** app (`in.freshyo.adminui`) on an iOS simulator. Kept in this
|
|
subdirectory (with its own `config.yaml`) so the parent `tests/e2e` suite glob
|
|
does not pick them up — they need seeded multi-region data (see below).
|
|
|
|
## Layout
|
|
|
|
```
|
|
tests/e2e/regions/
|
|
config.yaml # workspace config for this suite only
|
|
run.sh # loads .env and runs `maestro test`
|
|
.env.example # copy to .env and fill in
|
|
user-region-gate-manual-pick.yaml # test 13: gate picker -> home
|
|
user-login-password.yaml # reusable password login (OTP-free)
|
|
user-cart-add-item.yaml # add first product + first slot -> cart
|
|
user-cart-select-address.yaml # test 18: cross-region address preview
|
|
user-region-confirm-switch.yaml # tests 16/17: confirm + results dialog
|
|
admin-product-search.yaml # tests 5/6: product visible/absent
|
|
admin-const-edit-delivery-charge.yaml# test 4.1: edit own-region charge
|
|
```
|
|
|
|
The admin login step reuses `../subflows/login.yaml` (`STAFF_NAME`/`STAFF_PASSWORD`).
|
|
|
|
## Prerequisites
|
|
|
|
- Maestro CLI + a booted iOS simulator with both apps installed.
|
|
- Backend reachable from the simulator (`BASE_API_URL` in `packages/shared`).
|
|
- Multi-region seed data: at least 2 regions, a user account with addresses in
|
|
both regions and a non-empty scheduled cart for the address flows. The flows
|
|
were validated against regions `Mahabubnagar` (1) and `T-Hyd` (2); adjust
|
|
`.env` (`GATE_REGION_NAME`, `ADDRESS_LABEL`, `PRODUCT_NAME`) for your data.
|
|
- Known limits (verified Oct 2026): the user app reads products/slots/offers
|
|
from uploaded cache files — regions without uploaded cache sets render the
|
|
`Oops! Failed to load …` states instead of product lists.
|
|
|
|
## Setup / run
|
|
|
|
```bash
|
|
cp tests/e2e/regions/.env.example tests/e2e/regions/.env
|
|
# edit tests/e2e/regions/.env
|
|
bash tests/e2e/regions/run.sh # whole suite in config order
|
|
bash tests/e2e/regions/run.sh user-cart-add-item.yaml # single flow
|
|
```
|
|
|
|
## Test-case mapping
|
|
|
|
- `multi-region-tests.txt`: 5, 6 (admin search), 13 (gate pick), 16, 17, 18
|
|
(select address, confirm, results), 4.1-analogue (const edit).
|
|
- `docs/region-test-cases.txt`: §12.10 (address watcher), §12.4 (switch +
|
|
reconcile), §13.4 (manual pick), §13.10 (bars — asserted via testIDs on the
|
|
landing screens), §19.5 (cart selector, checkout card — same screens).
|