| .. | ||
| assets | ||
| subflows | ||
| .env.example | ||
| add-product.yaml | ||
| config.yaml | ||
| README.md | ||
| run.sh | ||
Admin E2E tests (Maestro)
Maestro flows that drive the admin-ui Expo app on an Android emulator.
Layout
tests/e2e/
config.yaml # workspace config (entry flows = *.yaml at the root)
add-product.yaml # first flow: create a product with 2 SKUs (one flash)
subflows/
login.yaml # reusable login
pick-image.yaml # OS photo-picker adapter (Android)
assets/test-product.png # seeded into the emulator gallery via `addMedia`
run.sh # sources .env and runs `maestro test`
.env.example # copy to .env and fill in
Prerequisites
- Maestro CLI installed (
curl -Ls "https://get.maestro.mobile.dev" | bash). - A booted Android emulator (
maestro start-device --platform android, or Android Studio). - The admin-ui dev build installed on the emulator (
bun run --filter admin-ui android, appIdin.freshyo.adminui). - The build must be able to reach the backend (login + image upload hit the API/R2).
Setup
cp tests/e2e/.env.example tests/e2e/.env
# edit tests/e2e/.env — at minimum STAFF_NAME, STAFF_PASSWORD, STORE_ID
Run
bash tests/e2e/run.sh # every entry flow in tests/e2e/
bash tests/e2e/run.sh add-product.yaml
run.sh appends a timestamp to PRODUCT_NAME (the backend rejects duplicate names).
What add-product.yaml does
addMediaseedsassets/test-product.pnginto the emulator gallery.launchAppwithclearState: true(forces login) and gallery permission.- Logs in (subflow) and taps the
add-product-menu-itemquick action. - Fills the product name and selects Store + Product Type.
- Variant 1: quantity, price, MRP, attaches an image.
- Adds Variant 2, fills quantity/prices, toggles Flash Available, sets flash price, attaches an image.
- Submits and asserts
Product created successfully!.
All in-app interactions use testID selectors (id:). The only exception is the
OS photo picker, which is system UI and is targeted by its platform IDs in
subflows/pick-image.yaml.
Notes / gotchas
- The image picker flow is the most version-sensitive part; thumbs are targeted by
the Android 13/14 Photo Picker id with a DocumentsUI fallback, and the confirm
button by text regex
Add|Done|Select. - On a reused emulator,
addMediaimages accumulate in the gallery (harmless). - Tests create real data on the connected backend.