74 lines
3.6 KiB
Markdown
74 lines
3.6 KiB
Markdown
# Full-suite E2E (tests/e2e-suite.txt)
|
||
|
||
End-to-end coverage of `tests/e2e-suite.txt`: superadmin (Playwright, steps 1–3),
|
||
admin app (Maestro on iOS sim, steps 4–11 + 24), user app (Maestro, steps 12–23).
|
||
|
||
## Why two runners
|
||
|
||
- `apps/superadmin-ui` is a **web app** — Maestro's Chromium driver is broken in
|
||
this env, so steps 1–3 run in Playwright (`tests/web/specs/e2e-setup.spec.ts`).
|
||
- The admin/user apps are Expo dev builds on the iOS simulator, driven by Maestro CLI
|
||
(`maestro test --udid …`). The Maestro MCP iOS bridge is currently wedged; CLI works.
|
||
|
||
## Prerequisites
|
||
|
||
- Backend + superadmin-ui running (`BACKEND_URL`, port 4175).
|
||
- iOS simulator booted with both dev builds installed; Metro (`expo run:ios`) up —
|
||
the Store/Tag/combo `testID`s load over JS, no native rebuild needed.
|
||
- `cp .env.example .env` and fill in `USER_MOBILE`/`USER_PASSWORD` etc.
|
||
|
||
## Run
|
||
|
||
```bash
|
||
npx playwright test --config tests/web/playwright.config.ts e2e-setup # steps 1-3, writes .env.e2e
|
||
bash tests/e2e/full-suite/run.sh # steps 4-24
|
||
bash tests/e2e/full-suite/run.sh user-journey.yaml # subset (reuses last readback)
|
||
```
|
||
|
||
## How it works
|
||
|
||
- The Playwright setup spec reuses **region 1 (Mahabubnagar)**, creates a fresh
|
||
timestamped region-1 admin, and writes `.env.e2e`
|
||
(`STAMP/ADMIN_NAME/ADMIN_PASSWORD/REGION_ID`). All suite entities are named
|
||
`E2E<stamp> …` so reruns never collide (backend rejects duplicate product names).
|
||
- `run.sh` pins the sim inside Mbnr-1 via
|
||
`xcrun simctl location <udid> set 16.7338,77.989` (step 12), then runs flows in
|
||
`config.yaml` order, with `scripts/readback.py` resolving real IDs between legs
|
||
(staff → stores → slots) into `gen/readback.env`.
|
||
- Step 10: `scripts/gen_slots.py` generates `gen/admin-slots.yaml` **seconds before**
|
||
it runs — 8 slots 2h apart, freeze 15 min prior, all suite SKUs attached. iOS
|
||
pickers open at *now*, so date nav (calendar + `DatePicker.NextMonth`), hour
|
||
walks, and the relative 15-tap freeze-minute walk are computed from gen time.
|
||
`readback.py --slots` verifies spacing/freeze/SKUs afterwards and fails fast if
|
||
an hour boundary rolled over mid-flow (rerun the suite in that case).
|
||
- Step 9 (offers): `isOffer` flags on 3 SKUs (P1-V1, P2-V0, P2-V2); the combo
|
||
surfaces under the Offers tab → Combos section.
|
||
- Step 24 matches the order by customer mobile on Manage Orders.
|
||
|
||
## Layout
|
||
|
||
```
|
||
config.yaml # workspace + execution order
|
||
run.sh # orchestrator (env, geo-fix, readbacks, maestro invocations)
|
||
.env / .env.e2e # static config / generated per-run hand-off (gitignored)
|
||
admin-stores.yaml # step 5: 2 stores
|
||
admin-product-p1.yaml # step 6: 2-SKU product, store 1, region-only assert
|
||
admin-product-p2.yaml # step 7: 4-SKU product, store 2, images
|
||
admin-combo.yaml # step 8: combo with 2 included items
|
||
admin-tags.yaml # step 11: 2 dashboard tags, 1 product each
|
||
gen/admin-slots.yaml # step 10: GENERATED (see above)
|
||
user-journey.yaml # steps 13-23
|
||
admin-verify-order.yaml# step 24
|
||
subflows/ # login, login-user (password), fill-variant, pick-image-ios
|
||
scripts/ # gen_slots.py, readback.py
|
||
assets/test-product.png# seeded into the sim gallery per product flow
|
||
```
|
||
|
||
## Gotchas
|
||
|
||
- Suite runtime ~15–25 min (the 8-slot flow is ~270 wheel taps).
|
||
- Sim clock is IST; `gen_slots.py` assumes Asia/Kolkata.
|
||
- The iOS status bar and picker wheels share numeric text — all taps use
|
||
full-match regex, which keeps them unambiguous (verified by spike).
|
||
- `user-journey` uses `clearState: true` on the user app; admin flows keep state
|
||
and log in conditionally.
|