# Admin Mobile E2E (Maestro)

Maestro flows for the Oshun Admin mobile cockpit. Mirrors the consumer mobile
harness (`apps/oshun/mobile/e2e/`) so CI and operator workstations invoke
admin-mobile flows through the same mental model: a `config.yaml` at the root of
this directory sets the canonical bundle id and env vars, `flows/` contains the
YAML flows, and a runner script in `../scripts/run-admin-mobile-maestro.sh`
dispatches by suite name.

## Suites

| Suite        | Target                                          | Covers                                                                          |
| ------------ | ----------------------------------------------- | ------------------------------------------------------------------------------- |
| `smoke`      | `flows/smoke-suite.yaml`                        | Login + step-up redirect.                                                       |
| `auth`       | `flows/auth/login-suite.yaml`                   | Full login happy path (V1-AMOB-013).                                            |
| `step-up`    | `flows/step-up/step-up-redirect.yaml`           | Step-up redirect + cancel path (V1-AMOB-013).                                   |
| `review`     | `flows/review/urgent-review-actions.yaml`       | Review action sheet — rationale + submit (V1-AMOB-014).                         |
| `incidents`  | `flows/incidents/incident-acknowledgement.yaml` | Incident acknowledgement happy path + terminal incident (V1-AMOB-015).          |
| `signoff`    | `flows/signoff-suite.yaml`                      | Redesigned urgent queue home + incident + offline-retry surfaces (V1-AMOB-024). |
| `regression` | `flows/regression-suite.yaml`                   | Smoke + review + incidents + signoff regression (expands as flows ship).        |

## Running

```bash
cd apps/oshun/admin-mobile
pnpm run e2e:smoke
```

Or via Nx:

```bash
pnpm nx e2e @oshun/admin-mobile
pnpm nx e2e:auth @oshun/admin-mobile
pnpm nx e2e:step-up @oshun/admin-mobile
pnpm nx e2e:review @oshun/admin-mobile
pnpm nx e2e:regression @oshun/admin-mobile
```

The runner sets `APP_ID=com.oshun.admin.mobile` and default admin test
credentials (`maestro-admin-studio@oshun.app`) so local runs target the dev
BFF's seeded studio operator. Override any env var before invoking the script:

```bash
ADMIN_AUTH_EMAIL=operator@example.com \
ADMIN_AUTH_PASSWORD='yourpassword' \
bash scripts/run-admin-mobile-maestro.sh smoke
```

## Flow authorship notes

- Every flow starts with `common/clear-and-launch.yaml` so tests always begin
  from a signed-out shell.
- Sign-in uses `common/sign-in-operator.yaml`; reuse it through `runFlow` with
  environment overrides for different test accounts.
- Shell-critical screens expose stable `testID`s: `admin-mobile-login`,
  `admin-mobile-login-email`, `admin-mobile-login-password`,
  `admin-mobile-login-submit`, `admin-mobile-shell-header`,
  `admin-mobile-urgent`, `admin-mobile-step-up`, `admin-mobile-step-up-submit`,
  `admin-mobile-step-up-cancel`, `admin-mobile-more-directory`.
- New step-up flows should target a workspace that requires `device-biometric`
  (`review`) or `hardware-token` (`trust-safety`, `incidents`, `personas`,
  `models`).
