|
| 1 | +# Maestro E2E tests |
| 2 | + |
| 3 | +These flows exercise Pixela Buttons through the native UI with |
| 4 | +[Maestro](https://maestro.mobile.dev/). |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +- Install Maestro: `curl -fsSL "https://get.maestro.mobile.dev" | bash` |
| 9 | +- Start one iOS simulator or Android emulator. |
| 10 | +- Install and launch the app once with Flutter, or keep `flutter run` attached |
| 11 | + while running Maestro. |
| 12 | +- Set the simulator/emulator language to Japanese. The flows intentionally use |
| 13 | + the Japanese UI text. |
| 14 | + |
| 15 | +## Environment variables |
| 16 | + |
| 17 | +The tests use real Pixela API calls. Do not commit credentials. |
| 18 | + |
| 19 | +The default suite creates one disposable Pixela user, reuses that user through |
| 20 | +the login, graph, card, recording, and settings flows, then deletes the user in |
| 21 | +the final flow. |
| 22 | + |
| 23 | +User defaults: |
| 24 | + |
| 25 | +- `PIXELA_E2E_USERNAME`: disposable user name for the full suite. If you use |
| 26 | + `scripts/maestro_test.sh`, a unique default is generated. |
| 27 | +- `PIXELA_E2E_TOKEN`: token for the disposable user. If you use |
| 28 | + `scripts/maestro_test.sh`, a unique default is generated. |
| 29 | + |
| 30 | +Legacy aliases: |
| 31 | + |
| 32 | +- `PIXELA_E2E_NEW_USERNAME` and `PIXELA_E2E_NEW_TOKEN` are still accepted by |
| 33 | + `scripts/maestro_test.sh` when `PIXELA_E2E_USERNAME` and |
| 34 | + `PIXELA_E2E_TOKEN` are not set. |
| 35 | + |
| 36 | +Optional defaults: |
| 37 | + |
| 38 | +- `PIXELA_E2E_BAD_USERNAME`: defaults to `pixela-buttons-invalid-user` |
| 39 | +- `PIXELA_E2E_BAD_TOKEN`: defaults to `invalid-token-for-maestro` |
| 40 | +- `PIXELA_E2E_GRAPH_ID`: defaults to a unique `mb<timestamp>` value in |
| 41 | + `scripts/maestro_test.sh` |
| 42 | +- `PIXELA_E2E_GRAPH_NAME`: defaults to `Maestro Graph` |
| 43 | +- `PIXELA_E2E_GRAPH_UNIT`: defaults to `count` |
| 44 | +- `PIXELA_E2E_CARD_NAME`: defaults to `Maestro Card` |
| 45 | +- `PIXELA_E2E_FLOW_DELAY_SECONDS`: seconds to wait between flows in the default |
| 46 | + local suite. Defaults to `5` to reduce accidental Pixela rate limiting. |
| 47 | + |
| 48 | +## Run |
| 49 | + |
| 50 | +```bash |
| 51 | +scripts/maestro_test.sh |
| 52 | +``` |
| 53 | + |
| 54 | +To run a single flow: |
| 55 | + |
| 56 | +```bash |
| 57 | +scripts/maestro_test.sh .maestro/flows/03_login_success.yaml |
| 58 | +``` |
| 59 | + |
| 60 | +## Local CI helper |
| 61 | + |
| 62 | +GitHub Actions does not run the full Maestro suite because iOS simulator and |
| 63 | +XCTest driver behavior on hosted runners has been unstable for these flows. |
| 64 | +Run the suite locally before releases or when touching registration, login, |
| 65 | +graph, card, reminder, settings, or account-deletion behavior. |
| 66 | + |
| 67 | +For local iOS verification, build the simulator app and run: |
| 68 | + |
| 69 | +```bash |
| 70 | +scripts/maestro_ci.sh |
| 71 | +``` |
| 72 | + |
| 73 | +The local suite creates a disposable Pixela user and deletes it in the final |
| 74 | +flow. If the run is cancelled before the final flow, the temporary Pixela user |
| 75 | +may remain and should be cleaned up manually. |
| 76 | + |
| 77 | +## Notes |
| 78 | + |
| 79 | +- The default `scripts/maestro_test.sh` run executes the numbered flows in |
| 80 | + order. The suite is intentionally order-dependent. |
| 81 | +- `01_register_new_user.yaml` creates `PIXELA_E2E_USERNAME`. |
| 82 | +- `04_create_graph.yaml` creates a real Pixela graph for that user. Use a fresh |
| 83 | + `PIXELA_E2E_GRAPH_ID` for each full run. |
| 84 | +- `11_delete_account.yaml` deletes `PIXELA_E2E_USERNAME`, then verifies the |
| 85 | + deleted user cannot log in. |
| 86 | +- If the suite stops before `11_delete_account.yaml`, the disposable Pixela user |
| 87 | + and graph may remain and should be cleaned up manually. |
| 88 | +- Notification permission text is OS-controlled. The reminder flow verifies |
| 89 | + the app reaches the reminder creation path and looks for a Japanese |
| 90 | + notification permission dialog. |
0 commit comments