Documentation comes from this release commit, without inheriting newer content. Commit: 63ea8c2b3d.
Maestro E2E Testing
End-to-end flows for Magic Piano's logic, run against the Release simulator app (JS bundled) — the same
artifact CI builds on every merge to dev and publishes to the package registry. One runner for everything:
run-release.sh (bun run e2e:release). Full guide: docs/runtime-provider.md.
Flows are run by a developer or CI. AI agents run them only when the user asks (see testing-and-quality.mdc).
Layout
Running
Every run writes build/e2e/: report.xml (JUnit), artifacts/ (a screenshot + command log of a failing flow) and, with
RECORD_VIDEO=1 / on CI, video/e2e-run.mp4 — the whole run at a constant 60 fps (the raw simulator recording is
variable-frame-rate: it only writes frames when the screen changes, so static screens look "low fps" until it is re-encoded).
The folder is git-ignored. On merge requests the suite (e2e_mr) is a manual job: play it on the MR pipeline to run the flows and link the video from the MR. It does not start on its own.
Prerequisites: Maestro CLI (curl -fsSL https://get.maestro.mobile.dev | bash), Xcode with an iOS simulator, and
for the registry path a GITLAB_TOKEN (read_package_registry). Building your own app: see the docs link above.
The mock catalog and how a song is played for real
In an e2e build (e2e.env) the catalog is src/core/e2e/e2e-mock-catalog.pure.ts: E2E Play Song (easy), E2E Hard
Song and Twinkle Twinkle Little Star (the tutorial's song), all on one hand-authored chart at 60 BPM:
C4 single, E4 single, G4 hold (2 s), D4 single. No remote catalog can override it, and the tutorial's own excerpt
chart is replaced by it. There is no "finish" shortcut: a flow plays the song with real taps.
The game waits on the hit line for each tile (auto-pause), and a tap within 2 s of the tile freezing there is Perfect+,
so a flow needs no clock sync (subflows/play-mock-song.yaml): wait for the first tile, then tap the keys in order,
long-pressing the hold. A clean run is 4 x Perfect+ (12) + the hold bonus = Score 58, 3 stars. Keys sit at fixed
positions in landscape percentages (A3..C5 at 5%, 15% ... 95% of the width, white-key faces at ~92% of the height).
How the flows cope with iOS UI automation (read before writing a flow)
- Build switches (
e2e.env):EXPO_PUBLIC_E2E=1(no intro film, which would redraw every frame),EXPO_PUBLIC_E2E_MOCK_CATALOG=1. A flow launches witharguments: { e2eSkipFtue: "1" }to start past onboarding + tutorial (subflows/launch-app.yaml; every flow but the first-run one), or without it to walk the first run. - Reduce Motion:
run-release.shboots the simulator with iOS Reduce Motion on (sim:prepare) so looping animations settle. - Orientation (the big one): the intro is portrait, everything after it landscape. On a headless simulator iOS UI
automation takes the device for whatever orientation was last set, so with the wrong one the tree is empty (portrait
screen, landscape device) or taps land at rotated positions (landscape screen, portrait device). The setting persists
across runs: every flow sets it explicitly (
setOrientation: LANDSCAPE_LEFTinlaunch-app.yaml;PORTRAITfor the intro in00-first-run.yaml, thenLANDSCAPE_LEFT). - Not exposed to automation: some modal controls (name dialog field, settings close X) have no accessibility id.
Flows type into the focused field + press Enter, or tap by position (
point: "96%,9%", landscape percentages). - Waits: always
extendedWaitUntilafter navigation;subflows/sleep.yamlfor a fixed delay (Maestro has no sleep).
📦 Automated CI/CD iOS Simulator Builds & Artifacts
1. Build Pipeline (currently disabled)
The simulator build workflow was already disabled on GitHub Actions and was not ported when CI moved to GitLab (
.gitlab-ci.yml, see docs/ci-cd.md). Build the simulator.applocally (xcodebuild -sdk iphonesimulator) until a GitLab job (e.g.artifacts:+expire_in: 7 days) is added;bun run e2e:downloadstill targets the old GitHub artifact and will not work.
1b. Release simulator app from the GitLab registry (current)
CI job
sim_release_publishbuilds the Release simulator app (JS bundled) when run manually (Run pipeline →PIPELINE_TARGET=sim-release) and publishes it to the package registry.bun run e2e:release(.maestro/run-release.sh) downloads the newest one, boots a simulator, installs it clean and runs.maestro/flowswith a JUnit report inbuild/e2e/; CI jobe2e_maestrodoes the same only when you Run pipeline →PIPELINE_TARGET=e2e, against the newest published build. A push todevdoes not start it. Details and Maestro MCP setup: docs/runtime-provider.md.
2. Downloading & Installing Artifacts Locally
Legacy flow (needs a pipeline that publishes the ios-simulator-app-* GitHub artifact; not available after the GitLab migration):
🎵 Song catalog end-to-end (.maestro/catalog/)
Drives the real app on a simulator against a local CDN: bundled catalog by default, a newer remote catalog overrides it, a song with no bundled chart downloads its MIDI on demand, and a cold restart (server up or down) serves everything from disk.
run.sh starts the CDN (scripts/catalog-e2e-server.ts) and its own Metro (port 8097, EXPO_PUBLIC_CATALOG_URL pointing at the CDN), wipes the catalog's MMKV/media state between scenarios, runs the five flows and asserts what the server saw (request counts). Notes: the sidebar mounts under the loading splash, so launch.yaml waits for the splash to disappear; Maestro env defaults (${APP_ID:-…}) are not supported by Maestro — pass -e APP_ID=….