Next · Unreleased
Working-tree content. Subject to change and not yet released. Commit: e3d4530507.
#subflows
#subflows/bootstrap-app.yaml
appId: ${APP_ID}
---
# Bootstrap App: launch an already-onboarded app (see flows/00-first-run.yaml for a clean install),
# dismiss any paywall / offer, and wait until the home screen is usable.
- runFlow:
file: "launch-app.yaml"
# The Debug app can show React Native's LogBox toast / error sheet over the app; the Release app never does.
- runFlow:
when:
true: ${typeof E2E_MODE !== 'undefined' && E2E_MODE == 'debug'}
commands:
- runFlow: dismiss-dev-overlays.yaml
# A cold start shows the loading splash first ("Use headphones for better experience… 99%");
# the sidebar mounts under it, so wait for it to go before touching anything.
- extendedWaitUntil:
visible:
id: "tab-button-songs"
timeout: 120000
optional: true
- extendedWaitUntil:
notVisible: ".*Use headphones.*"
timeout: 120000
- runFlow:
when:
visible:
id: "paywall-close"
commands:
- tapOn:
id: "paywall-close"
- runFlow:
when:
visible:
id: "sale-off-50-close"
commands:
- tapOn:
id: "sale-off-50-close"
- extendedWaitUntil:
visible:
id: "tab-button-songs"
timeout: 30000#subflows/buy-from-promo.yaml
appId: ${APP_ID}
---
# Buying No Ads from the song list's promo row (it sells `shop.noads_banner.product` of the arm's tier),
# with the e2e store (the purchase succeeds) and the e2e ads (E2E_ADS=1):
# ${PROMO_ID} the product the promo sells: after the purchase the Shop lists it as owned
# (`shop-lifetime-owned-<id>`, a lifetime pack)
# Then the promo row is gone, and a song shows no interstitial and no banner (expect-no-ads.yaml).
- runFlow: launch-app-clean.yaml
- runFlow: to-song-list.yaml
# The whole row is one accessible button (`remove-ads-promo`): its price pill (`remove-ads-promo-cta`)
# is not in the accessibility tree, so tap the row — the same purchase.
- scrollUntilVisible:
element:
id: "remove-ads-promo"
timeout: 15000
- tapOn:
id: "remove-ads-promo"
- extendedWaitUntil:
notVisible:
id: "remove-ads-promo"
timeout: 30000
- runFlow: expect-no-ads.yaml
- tapOn:
id: "session-action-songs"
- extendedWaitUntil:
visible:
id: "songs-search-input"
timeout: 60000
- tapOn:
id: "tab-button-shop"
- extendedWaitUntil:
visible:
id: "shop-lifetime-owned-${PROMO_ID}"
timeout: 30000#subflows/connect-dev-client.yaml
appId: ${APP_ID}
---
# Debug build only: point the Expo dev client at Metro and get past what it puts on top of the app.
# (The Release app has no dev client and never runs this; see launch-app.yaml.)
#
# - The link opens the project straight away, so the launcher's server list never shows.
# - `__expo_disable_fab` removes the floating "Tools" button: it is draggable and can sit on top of a
# row's Play button and swallow the tap. `__expo_disable_onboarding` / `__expo_disable_auto_launch`
# keep the developer-menu intro and the auto-opened menu away.
- openLink: "${APP_ID}://expo-development-client/?url=http%3A%2F%2Flocalhost%3A${METRO_PORT}&__expo_disable_fab=1&__expo_disable_onboarding=1&__expo_disable_auto_launch=1"
# The link uses the app's own scheme (its bundle id), not `magicpiano://`: another dev shell on the same
# simulator may register a scheme of its own, and a link must open this app.
# What the link can leave on screen, each step only when it is there: iOS asks "Open in <app>?" before a
# custom-scheme link opens an app (always on a simulator that has not opened one yet, and whenever the app is
# not already in front); a Metro / native runtime that was not ready yet shows a red "runtime not ready" screen
# (reload it); the very first dev-client launch of an install can still show the menu intro (it never returns).
#
# Each is a hierarchy request, and right after the link the dev client is still starting: the XCTest driver can
# answer with a 500 (kAXErrorInvalidUIElement). Maestro does NOT retry that (it is not a failed command but a
# driver error that ends the flow as "Unknown error"; a `retry:` here ran once), so the pause comes first, to
# make it rare, and run-variants.sh runs a flow again when it ends that way. The pause must not read the
# screen itself (pause.yaml, not sleep.yaml: that one is a hierarchy request too).
- runFlow:
file: "pause.yaml"
env:
MS: "8000"
- runFlow:
when:
visible: "Open in .*"
commands:
- tapOn: "Open"
- runFlow:
when:
visible: ".*runtime not ready.*"
commands:
- tapOn: "Reload"
- runFlow:
when:
visible: ".*developer menu.*"
commands:
- tapOn: "Continue"#subflows/dismiss-dev-overlays.yaml
appId: ${APP_ID}
---
# Debug build only: React Native's LogBox puts a warning / error toast at the bottom of the screen,
# and a red "Uncaught Error" sheet can cover the app. Dismiss what is there so the next tap lands on the app.
# Every step is optional: the Release app shows none of this, and a Debug run often shows nothing either.
- runFlow:
when:
visible: "Dismiss"
commands:
- tapOn: "Dismiss"
- runFlow:
when:
visible: "Minimize"
commands:
- tapOn: "Minimize"#subflows/dismiss-offers.yaml
appId: ${APP_ID}
---
# Closes what may open over the song list on its own: the subscription offers (the launch / home-return
# paywall, the 50% sale) and "Learn Mode unlocked!" (it opens once 3 songs are finished — a seeded
# `e2eSongEnds` count passes that at launch). Leaves the No Ads popup and the fake ads alone: the flows
# that care assert those.
- runFlow:
when:
visible:
id: "learn-unlocked-close"
commands:
- tapOn:
id: "learn-unlocked-close"
- runFlow:
when:
visible:
id: "paywall-close"
commands:
- tapOn:
id: "paywall-close"
- runFlow:
when:
visible:
id: "sale-off-50-close"
commands:
- tapOn:
id: "sale-off-50-close"#subflows/expect-no-ads.yaml
appId: ${APP_ID}
---
# After a No Ads purchase: back on the song list, one more song — no interstitial on the song-row tap
# or at its end, no banner on its result, no promo row on the list.
- runFlow: dismiss-offers.yaml
- runFlow:
when:
visible:
id: "session-action-songs"
commands:
- tapOn:
id: "session-action-songs"
- runFlow: to-song-list.yaml
- assertNotVisible:
id: "remove-ads-promo"
- tapOn:
id: "song-row-play-e2e-play"
- runFlow:
file: sleep.yaml
env:
MS: "6000"
- assertNotVisible:
id: "e2e-ad-interstitial"
- runFlow: play-mock-notes.yaml
# No ad now, so the result itself comes (with ads a song-end interstitial would open first).
- extendedWaitUntil:
visible:
id: "session-result-score"
timeout: 60000
- runFlow:
file: sleep.yaml
env:
MS: "6000"
- assertNotVisible:
id: "e2e-ad-interstitial"
- assertNotVisible:
id: "e2e-banner"#subflows/expect-paywall-trial.yaml
appId: ${APP_ID}
---
# On a paywall that is open: the live store prices have loaded, then the trial is (or is not) promised.
# ${TRIAL_PATTERN} the text the paywall shows when its package carries the 3-day trial
# ${EXPECT_TRIAL} "1" it must be on screen, anything else it must not be
# The wait for a price comes first so "no trial" is read from a loaded paywall, not from one still
# loading (the loading state shows no price line at all). The e2e IAP backend (e2e-iap-service.ts) sells
# the trial from its `default` offering only, so this tells which offering the running arm asked for.
- extendedWaitUntil:
visible:
id: "paywall-cta"
timeout: 30000
- extendedWaitUntil:
visible: ".*(4\\.99|39\\.99).*"
timeout: 30000
- runFlow:
when:
true: ${EXPECT_TRIAL == '1'}
commands:
- assertVisible: ${TRIAL_PATTERN}
- runFlow:
when:
true: ${EXPECT_TRIAL != '1'}
commands:
- assertNotVisible: ${TRIAL_PATTERN}#subflows/first-run-intro.yaml
appId: ${APP_ID}
---
# The first run's first step, from a clean install: launch fresh, wait for the intro and press Start.
# What comes next depends on the player: a free one meets the post-onboarding paywall (portrait) before
# the tutorial, a premium one goes straight to it. The caller handles that, then runs
# first-run-tutorial.yaml. (The intro is portrait; the app turns landscape once it is past.)
- runFlow: launch-fresh.yaml
# The XCTest driver can fail a hierarchy request (500, kAXErrorInvalidUIElement) while the app is still
# starting. Maestro ends the flow on that ("Unknown error"); run-variants.sh runs it again. The pause first makes it rare.
- retry:
maxRetries: 6
commands:
- runFlow:
file: "pause.yaml"
env:
MS: "3000"
- extendedWaitUntil:
visible:
id: "onboarding-start"
timeout: 60000
# Start is on screen before it answers a touch: the splash's gates (navigation shell, warm-ups, chime)
# hold the intro inert for a few seconds more, and a tap in that window is swallowed without an error.
- runFlow:
file: "pause.yaml"
env:
MS: "7000"
- tapOn:
id: "onboarding-start"#subflows/first-run-tutorial.yaml
appId: ${APP_ID}
---
# The rest of the first run, played for real on the mock catalog, from the intro's Start (or the
# post-onboarding paywall's close) to the song list:
# tutorial welcome -> practice training (tap + hold drill) -> the tutorial song (C4, E4, G4 hold, D4)
# -> "Congrats!" -> pick a free song -> its gameplay -> pause -> song list.
# Everything after the intro is landscape, so Maestro's orientation turns with it.
- setOrientation: LANDSCAPE_LEFT
# 2. Tutorial welcome.
- extendedWaitUntil:
visible:
id: "tutorial-welcome-cta"
timeout: 60000
- tapOn:
id: "tutorial-welcome-cta"
# 3. Practice training. The Skip pill is on screen for the whole drill section.
- extendedWaitUntil:
visible:
id: "tutorial-skip"
timeout: 60000
# The intro copy, then the tap drill's note drops and rests on the line: any press on its key (B3,
# the 7th of the 12 white keys C3..G4) is Perfect+, so it only has to be there.
- runFlow:
file: "sleep.yaml"
env:
MS: "9000"
- tapOn:
point: "54%,92%"
# "Easy, isn't it?", then the hold drill's long note rests on the line: press B3 and keep holding it.
- runFlow:
file: "sleep.yaml"
env:
MS: "9000"
- longPressOn:
point: "54%,92%"
# 4. "Training finished!", "Now you're ready...", the song's showcase, then the 3-2-1. The song waits on
# its first tile (late taps still count in the tutorial), so a long wait is safe.
- runFlow:
file: "sleep.yaml"
env:
MS: "18000"
- tapOn:
point: "25%,92%"
- tapOn:
point: "45%,92%"
- longPressOn:
point: "65%,92%"
- tapOn:
point: "35%,92%"
# 5. "Congrats!", then the picker: choose the free song.
- extendedWaitUntil:
visible:
id: "tutorial-result-title"
timeout: 60000
- extendedWaitUntil:
visible:
id: "tutorial-pick-cta-e2e-play"
timeout: 60000
- assertVisible:
id: "tutorial-pick-cta-e2e-hard"
- tapOn:
id: "tutorial-pick-cta-e2e-play"
# 6. The chosen song starts (a normal game screen now); leave it for the song list.
- extendedWaitUntil:
visible:
id: "gameplay-header-pause"
timeout: 90000
- tapOn:
id: "gameplay-header-pause"
- extendedWaitUntil:
visible:
id: "session-action-songs"
timeout: 15000
- tapOn:
id: "session-action-songs"
- extendedWaitUntil:
visible:
id: "songs-search-input"
timeout: 60000
- assertVisible:
id: "tab-button-profile"#subflows/handle-e2e-ad.yaml
appId: ${APP_ID}
---
# Meets the fake interstitial that may open now (EXPO_PUBLIC_E2E_ADS=1: `e2e-ad-interstitial`, labelled
# "E2E interstitial #<n>", n counted since launch) and closes it, checking the No Ads popup rule:
# ${WAIT_MS} how long an ad may take to open (it opens right after a song end or a song-row tap)
# ${EARLY} regex of the labels BEFORE the popup's turn: after closing one, the popup must not open
# ${MODE} "expect": close every ad (the popup may open after a later one)
# "never": close the early ones only; leave a later one up, the caller's loop stops on it
- extendedWaitUntil:
visible:
id: "e2e-ad-interstitial"
timeout: ${WAIT_MS}
optional: true
- runFlow:
when:
visible:
id: "e2e-ad-interstitial"
text: ${EARLY}
commands:
- tapOn:
id: "e2e-ad-close"
# Give the popup its full chance before saying it did not open: it would open over the result,
# after the result's reveal. (After a song-row ad the song starts instead; the wait just runs out.)
- extendedWaitUntil:
visible:
id: "session-action-songs"
timeout: 15000
optional: true
- runFlow:
file: sleep.yaml
env:
MS: "5000"
- assertNotVisible:
id: "noads-popup-close"
- runFlow:
when:
true: ${MODE == 'expect'}
visible:
id: "e2e-ad-interstitial"
commands:
- tapOn:
id: "e2e-ad-close"
- runFlow:
file: sleep.yaml
env:
MS: "4000"#subflows/launch-app-clean.yaml
appId: ${APP_ID}
---
# Like launch-app.yaml, but a clean install (state cleared) that starts past the first run.
# Cold-start the app under test, in either build the suite runs against (E2E_MODE, set by run-release.sh):
# release (default) the bundled Release simulator app: just launch it.
# debug the Expo dev client: JS comes from Metro (METRO_PORT), so open the project link.
# `e2eSkipFtue` starts the app past onboarding + the tutorial (src/bootstrap/e2e-skip-ftue.ts); a flow
# that walks the first run starts from launch-fresh.yaml instead.
- runFlow:
when:
true: ${typeof E2E_MODE !== 'undefined' && E2E_MODE == 'debug'}
commands:
- stopApp
- launchApp:
clearState: true
stopApp: true
arguments:
e2eSkipFtue: "1"
- runFlow: connect-dev-client.yaml
- runFlow:
when:
true: ${typeof E2E_MODE === 'undefined' || E2E_MODE != 'debug'}
commands:
- launchApp:
clearState: true
arguments:
e2eSkipFtue: "1"
# The app is landscape-only after its intro. On a headless simulator iOS UI automation takes the device
# for portrait while the app draws landscape, so Maestro's taps land at rotated positions (an element's
# id is found, but tapping it hits something else). Telling Maestro the orientation fixes the mapping.
- setOrientation: LANDSCAPE_LEFT#subflows/launch-app-seeded.yaml
appId: ${APP_ID}
---
# Like launch-app-clean.yaml (a clean install that starts past the first run), plus a seeded lifetime
# song-end count, so the interstitial gate (`fs.firstAfterSongEnd`, 2 or 3 by arm) is already open:
# ${SONG_ENDS} finished songs to start with (src/bootstrap/e2e-song-ends.ts), e.g. "5"
- runFlow:
when:
true: ${typeof E2E_MODE !== 'undefined' && E2E_MODE == 'debug'}
commands:
- stopApp
- launchApp:
clearState: true
stopApp: true
arguments:
e2eSkipFtue: "1"
e2eSongEnds: ${SONG_ENDS}
- runFlow: connect-dev-client.yaml
- runFlow:
when:
true: ${typeof E2E_MODE === 'undefined' || E2E_MODE != 'debug'}
commands:
- launchApp:
clearState: true
arguments:
e2eSkipFtue: "1"
e2eSongEnds: ${SONG_ENDS}
- setOrientation: LANDSCAPE_LEFT#subflows/launch-app.yaml
appId: ${APP_ID}
---
# Cold-start the app under test, in either build the suite runs against (E2E_MODE, set by run-release.sh):
# release (default) the bundled Release simulator app: just launch it.
# debug the Expo dev client: JS comes from Metro (METRO_PORT), so open the project link.
# `e2eSkipFtue` starts the app past onboarding + the tutorial (src/bootstrap/e2e-skip-ftue.ts); a flow
# that walks the first run starts from launch-fresh.yaml instead.
- runFlow:
when:
true: ${typeof E2E_MODE !== 'undefined' && E2E_MODE == 'debug'}
commands:
- stopApp
- launchApp:
clearState: false
stopApp: true
arguments:
e2eSkipFtue: "1"
- runFlow: connect-dev-client.yaml
- runFlow:
when:
true: ${typeof E2E_MODE === 'undefined' || E2E_MODE != 'debug'}
commands:
- launchApp:
clearState: false
arguments:
e2eSkipFtue: "1"
# The app is landscape-only after its intro. On a headless simulator iOS UI automation takes the device
# for portrait while the app draws landscape, so Maestro's taps land at rotated positions (an element's
# id is found, but tapping it hits something else). Telling Maestro the orientation fixes the mapping.
- setOrientation: LANDSCAPE_LEFT#subflows/launch-fresh.yaml
appId: ${APP_ID}
---
# Cold-start the app as a brand-new install (state cleared), in either build (see launch-app.yaml),
# WITHOUT the `e2eSkipFtue` argument: the first run is the one that plays. A fresh install starts in
# portrait: the intro is the only portrait screen.
- runFlow:
when:
true: ${typeof E2E_MODE !== 'undefined' && E2E_MODE == 'debug'}
commands:
- stopApp
- launchApp:
clearState: true
stopApp: true
- runFlow: connect-dev-client.yaml
- runFlow:
when:
true: ${typeof E2E_MODE === 'undefined' || E2E_MODE != 'debug'}
commands:
- launchApp:
clearState: true
- setOrientation: PORTRAIT#subflows/launch-paywall.yaml
appId: ${APP_ID}
---
# The paywall a cold launch owes (`paywall.launch_paywall`, from the 2nd session): a clean install past
# the first run is session 1; a cold restart is session 2 and opens the offer over the song list.
# ${EXPECT_PAYWALL} "1": it opens; anything else: it does not, however long the song list stays up
- runFlow: launch-app-clean.yaml
- extendedWaitUntil:
visible:
id: "songs-search-input"
timeout: 120000
# Session 1 owes none: close one if this install happens to meet a paywall, so session 2 starts clean.
- runFlow:
when:
visible:
id: "paywall-close"
commands:
- tapOn:
id: "paywall-close"
- runFlow: launch-app.yaml
- runFlow:
when:
true: ${EXPECT_PAYWALL == '1'}
commands:
- extendedWaitUntil:
visible:
id: "paywall-cta"
timeout: 60000
- tapOn:
id: "paywall-close"
- runFlow:
when:
true: ${EXPECT_PAYWALL != '1'}
commands:
- extendedWaitUntil:
visible:
id: "songs-search-input"
timeout: 120000
# The offer, when owed, opens within seconds of the list: wait longer than that, then look.
- runFlow:
file: sleep.yaml
env:
MS: "20000"
- assertNotVisible:
id: "paywall-cta"#subflows/leave-to-song-list.yaml
appId: ${APP_ID}
---
# From wherever the app went (a song's gameplay, its result, an offer over the list) back to the song
# list: pause and leave a running song, leave a result, close what opens on its own (dismiss-offers.yaml).
- repeat:
times: 20
while:
notVisible:
id: "songs-search-input"
commands:
- runFlow:
when:
visible:
id: "gameplay-header-pause"
commands:
- tapOn:
id: "gameplay-header-pause"
- runFlow:
when:
visible:
id: "session-action-songs"
commands:
- tapOn:
id: "session-action-songs"
- runFlow: dismiss-offers.yaml
- runFlow:
file: sleep.yaml
env:
MS: "3000"
- runFlow: to-song-list.yaml#subflows/navigate-to-tab.yaml
appId: ${APP_ID}
---
# Navigate to Tab: expects ${TAB_NAME} ('songs', 'profile', 'mission', 'leagues')
- tapOn:
id: "tab-button-${TAB_NAME}"
- extendedWaitUntil:
visible:
id: "tab-button-${TAB_NAME}"
timeout: 5000#subflows/noads-popup-cycle.yaml
appId: ${APP_ID}
---
# One song from the song list and back, meeting every fake interstitial on the way (handle-e2e-ad.yaml):
# the one a song-row tap may open (`fs.home_song_click`) and the one a song end opens. Stops early —
# leaving the screen as it is — once the No Ads popup is up or, in "never" mode, a late ad is left up.
# ${EARLY} ${MODE} as handle-e2e-ad.yaml
# ${COOLDOWN_MS} the arm's interstitial cooldown (`fs.cooldown_sec`): waited on the list, so the
# next song end may show one
- tapOn:
id: "song-row-play-e2e-play"
- runFlow:
file: handle-e2e-ad.yaml
env:
WAIT_MS: "6000"
EARLY: ${EARLY}
MODE: ${MODE}
- runFlow:
when:
notVisible:
id: "e2e-ad-interstitial"
commands:
- runFlow: play-mock-notes.yaml
# The song-end interstitial opens BEFORE the result screen.
- runFlow:
file: handle-e2e-ad.yaml
env:
WAIT_MS: "15000"
EARLY: ${EARLY}
MODE: ${MODE}
# The result, then the popup's moment (it opens over the result, after its reveal). Optional: with the
# popup already up, the result's buttons are under its modal.
- runFlow:
when:
notVisible:
id: "e2e-ad-interstitial"
commands:
- extendedWaitUntil:
visible:
id: "session-action-songs"
timeout: 30000
optional: true
- runFlow:
file: sleep.yaml
env:
MS: "5000"
# Back to the list for the next song, unless the popup or a late ad is up (the caller's loop stops on those).
- runFlow:
when:
notVisible:
id: "noads-popup-close"
commands:
- runFlow:
when:
notVisible:
id: "e2e-ad-interstitial"
commands:
- runFlow: dismiss-offers.yaml
- tapOn:
id: "session-action-songs"
- extendedWaitUntil:
visible:
id: "songs-search-input"
timeout: 60000
- runFlow: dismiss-offers.yaml
- runFlow:
file: sleep.yaml
env:
MS: ${COOLDOWN_MS}#subflows/noads-popup.yaml
appId: ${APP_ID}
---
# The Remove Ads popup of one arm (`noads_popup`), with the e2e ads (E2E_ADS=1) and a seeded song-end
# count, so every song end may show an interstitial from the first song:
# ${POPUP_AT} `noads_popup.after_fs`: the popup opens after a song-end interstitial once this many
# have shown this session; "0" = never
# ${POPUP_PRICE} regex of the price the popup's buy button reads (its pack in the arm's tier), "-" for none
# ${COOLDOWN_MS} the arm's interstitial cooldown (`fs.cooldown_sec` in ms)
# ${BUY} "1": buy from the popup, then no interstitial and no banner follow
# Each value is checked against the arm's real config (src/data/__tests__/e2e-monetization-flows.test.ts).
#
# Proof, not just "a popup showed": every interstitial before the POPUP_AT-th closes WITHOUT the popup
# (handle-e2e-ad.yaml, EARLY), and for "0" three interstitials pass and none opens it.
- runFlow:
file: launch-app-seeded.yaml
env:
SONG_ENDS: "5"
- runFlow: to-song-list.yaml
# POPUP_AT 1 or 3: songs until the popup is up (at most 8), never before its turn.
- runFlow:
when:
true: ${POPUP_AT != '0'}
commands:
- repeat:
times: 8
while:
notVisible:
id: "noads-popup-close"
commands:
- runFlow:
file: noads-popup-cycle.yaml
env:
# Labels before the popup's turn: none for 1; #1 and #2 for 3.
EARLY: ${POPUP_AT == '3' ? 'E2E interstitial #[12]' : 'E2E interstitial #0'}
MODE: "expect"
COOLDOWN_MS: ${COOLDOWN_MS}
- assertVisible:
id: "noads-popup-close"
# The card's inside fades in piece by piece after the popup opens (noads-popup-reveal.ts: the
# CTA ~0.5 s in), and until then it is not in the accessibility tree: wait for it, then read
# its price — asserting at once raced the reveal.
- extendedWaitUntil:
visible:
id: "noads-popup-buy"
text: ${POPUP_PRICE}
timeout: 10000
# POPUP_AT 0: songs until the 3rd interstitial (at most 8); none of them brings the popup.
- runFlow:
when:
true: ${POPUP_AT == '0'}
commands:
- repeat:
times: 8
while:
notVisible:
text: "E2E interstitial #[3-9]"
commands:
- runFlow:
file: noads-popup-cycle.yaml
env:
EARLY: "E2E interstitial #[12]"
MODE: "never"
COOLDOWN_MS: ${COOLDOWN_MS}
- assertVisible:
text: "E2E interstitial #[3-9]"
- tapOn:
id: "e2e-ad-close"
- runFlow:
file: sleep.yaml
env:
MS: "6000"
- assertNotVisible:
id: "noads-popup-close"
# Buy from the popup: then the ads are gone (rewarded stays; nothing here asks for one).
- runFlow:
when:
true: ${BUY == '1'}
commands:
- tapOn:
id: "noads-popup-buy"
- extendedWaitUntil:
notVisible:
id: "noads-popup-close"
timeout: 30000
- runFlow: expect-no-ads.yaml
- runFlow:
when:
true: ${BUY != '1'}
visible:
id: "noads-popup-close"
commands:
- tapOn:
id: "noads-popup-close"#subflows/open-profile-paywall.yaml
appId: ${APP_ID}
---
# The paywall a player opens on purpose: Profile tab -> the go-premium button (screen "profile",
# landscape). Expects the song list or any tab to be up, and a free player (the button is for one).
- runFlow:
file: "navigate-to-tab.yaml"
env:
TAB_NAME: "profile"
- extendedWaitUntil:
visible:
id: "profile-go-premium"
timeout: 30000
- tapOn:
id: "profile-go-premium"#subflows/pause.yaml
appId: ${APP_ID}
---
# Waits ${MS} ms without reading the screen (see pause.js). Use it right after the app starts, while the
# XCTest driver cannot read it yet; `sleep.yaml` is the one for a settled screen.
- runScript:
file: pause.js
env:
MS: ${MS}#subflows/play-mock-notes.yaml
appId: ${APP_ID}
---
# The notes of the mock song (C4, E4, G4 hold, D4), from its gameplay screen to its last note — the
# second half of play-mock-song.yaml, for flows that tap the song row themselves (an interstitial
# can open on that tap: `fs.home_song_click`). See play-mock-song.yaml for the timing.
# Ends on the last note, NOT on the result: with the e2e ads a song-end interstitial opens BEFORE the
# result screen, so the caller waits for whichever it expects (noads-popup-cycle.yaml, expect-no-ads.yaml).
- extendedWaitUntil:
visible:
id: "gameplay-header-pause"
timeout: 60000
- extendedWaitUntil:
visible:
id: "no-such-element"
timeout: 3000
optional: true
- tapOn:
point: "25%,92%"
- tapOn:
point: "45%,92%"
- longPressOn:
point: "65%,92%"
- tapOn:
point: "35%,92%"#subflows/play-mock-song.yaml
appId: ${APP_ID}
---
# Plays the mock song for real, from the song list to the result screen:
# ${SONG_ID} catalog id of a mock song (e2e-play | e2e-hard), both on the same chart
# ${FIRST_NOTE_DELAY_MS} how long to wait before the first tap (default 3000)
#
# The chart (src/core/e2e/e2e-mock-catalog.pure.ts, 60 BPM): C4 single, E4 single, G4 HOLD (2 s), D4 single.
# The game WAITS on the hit line for each tile (auto-pause), and a tap within 2 s of the tile
# freezing there scores Perfect+, so no clock sync is needed: the first tile reaches the line ~2.3 s
# after the pause button shows, and every following tile 2 s after the previous tap or hold ends;
# Maestro's own tap overhead (~2.3 s) lands each tap inside that window. A clean run is
# 4 x Perfect+ plus the hold bonus = score 58, 3 stars.
#
# Keys: the keyboard fills the (landscape) screen height, 10 white keys A3..C5 at 5%, 15% ... 95%
# of the width; the white key faces sit at ~92% of the height (away from the black keys).
- tapOn:
id: "song-row-play-${SONG_ID}"
- extendedWaitUntil:
visible:
id: "gameplay-header-pause"
timeout: 60000
# Let the first tile arrive (a wait that always runs its full time: nothing named this is on screen).
- extendedWaitUntil:
visible:
id: "no-such-element"
timeout: ${FIRST_NOTE_DELAY_MS}
optional: true
# A wrong key does nothing: the tile stays frozen on the line, the score stays 0.
- tapOn:
point: "75%,92%"
# Note 1, C4 (single) -> note 2, E4 (single) -> note 3, G4 (hold: press and keep holding) -> note 4, D4 (single).
- tapOn:
point: "25%,92%"
- tapOn:
point: "45%,92%"
- longPressOn:
point: "65%,92%"
- tapOn:
point: "35%,92%"
# The song ends on its last note: the result screen.
- extendedWaitUntil:
visible:
id: "session-result-score"
timeout: 60000#subflows/post-onboarding-paywall.yaml
appId: ${APP_ID}
---
# The paywall right after onboarding, from a clean install (portrait): intro Start -> the paywall.
# ${EXPECT_TRIAL} "1": each plan card promises the 3-day trial; anything else: none does
# Needs the e2e IAP backend (a free player, only the `default` offering sells the trial) and onboarding
# script 1 or 2 (3 and 4 open no paywall here): run-variants.sh sets both. Closes it and waits for the
# tutorial's welcome, so the flow ends on a known screen without playing the first run (00-first-run does).
- runFlow: first-run-intro.yaml
- extendedWaitUntil:
visible:
id: "paywall-close"
timeout: 60000
- runFlow:
file: expect-paywall-trial.yaml
env:
TRIAL_PATTERN: ".*3-day free trial.*"
EXPECT_TRIAL: ${EXPECT_TRIAL}
- tapOn:
id: "paywall-close"
# Closing it completes onboarding: the app turns landscape for the tutorial.
- setOrientation: LANDSCAPE_LEFT
- extendedWaitUntil:
visible:
id: "tutorial-welcome-cta"
timeout: 60000#subflows/result-banner.yaml
appId: ${APP_ID}
---
# The banner on a song's result screen, for a free player, with the e2e ads (E2E_ADS=1):
# ${EXPECT_BANNER} "1": the `e2e-banner` placeholder shows on the result; anything else: it does not
# No seeded song ends: the first song end of an install is under every arm's `fs.first_after_song_end`,
# so no interstitial covers the result.
# One retry from a clean install: the XCTest driver now and then fails a point tap mid-song
# (`CommandFailed: null`, the app's accessibility server briefly unreachable), which says nothing
# about the banner.
- retry:
maxRetries: 1
commands:
- runFlow: launch-app-clean.yaml
- runFlow: to-song-list.yaml
- runFlow:
file: play-mock-song.yaml
env:
SONG_ID: "e2e-play"
FIRST_NOTE_DELAY_MS: "3000"
- runFlow:
when:
true: ${EXPECT_BANNER == '1'}
commands:
- extendedWaitUntil:
visible:
id: "e2e-banner"
timeout: 30000
- runFlow:
when:
true: ${EXPECT_BANNER != '1'}
commands:
- runFlow:
file: sleep.yaml
env:
MS: "10000"
- assertNotVisible:
id: "e2e-banner"#subflows/shop-entry.yaml
appId: ${APP_ID}
---
# Where an arm sells No Ads from the song list (`shop.enabled`, `shop.noads_banner.position`):
# ${EXPECT_SHOP} "1": the Shop tab and the song list's "Remove forced ads" promo row show; else neither
# ${PROMO_ROW} the promo's row: "1" above the first song, "3" below it (the mock list has 3 songs);
# "0" when there is no promo
# Each value is checked against the arm's real config (src/data/__tests__/e2e-monetization-flows.test.ts).
- runFlow: launch-app-clean.yaml
- runFlow: to-song-list.yaml
- runFlow:
when:
true: ${EXPECT_SHOP == '1'}
commands:
- assertVisible:
id: "tab-button-shop"
- scrollUntilVisible:
element:
id: "remove-ads-promo"
timeout: 15000
- runFlow:
when:
true: ${PROMO_ROW == '1'}
commands:
- assertVisible:
id: "remove-ads-promo"
above:
id: "song-row-preview-e2e-play"
- runFlow:
when:
true: ${PROMO_ROW == '3'}
commands:
- assertVisible:
id: "remove-ads-promo"
below:
id: "song-row-preview-e2e-play"
- runFlow:
when:
true: ${EXPECT_SHOP != '1'}
commands:
- assertNotVisible:
id: "tab-button-shop"
- assertNotVisible:
id: "remove-ads-promo"#subflows/shop-screen.yaml
appId: ${APP_ID}
---
# The Shop of an arm that has one (`shop.enabled`): its premium card and its No Ads packs.
# ${EXPECT_TRIAL_TEXT} "1": the card promises "3-Day Free Trial"; anything else: it does not (`shop.trialText`)
# ${DAY_ID} ${DAY_PRICE} the 1-day pack of the arm's tier (`noads.tier`): product id, price regex
# ${LIFETIME_ID} ${LIFETIME_PRICE} the lifetime pack of that tier
# Each value is checked against the arm's real config (src/data/__tests__/e2e-monetization-flows.test.ts).
- runFlow: launch-app-clean.yaml
- runFlow: to-song-list.yaml
- tapOn:
id: "tab-button-shop"
- extendedWaitUntil:
visible:
id: "shop-screen"
timeout: 30000
- extendedWaitUntil:
visible:
id: "shop-try-free"
timeout: 30000
- runFlow:
when:
true: ${EXPECT_TRIAL_TEXT == '1'}
commands:
- assertVisible: ".*3-Day Free Trial.*"
- runFlow:
when:
true: ${EXPECT_TRIAL_TEXT != '1'}
commands:
- assertNotVisible: ".*3-Day Free Trial.*"
# The tier's packs, by product id, each with its price.
- extendedWaitUntil:
visible:
id: "shop-pack-${LIFETIME_ID}"
timeout: 30000
# The cards fade in one after another (FadeInUp with growing delays): wait for each, never assert at once.
- extendedWaitUntil:
visible:
id: "shop-pack-${LIFETIME_ID}"
text: ${LIFETIME_PRICE}
timeout: 10000
- extendedWaitUntil:
visible:
id: "shop-pack-${DAY_ID}"
text: ${DAY_PRICE}
timeout: 10000
# "See All Plans" opens the subscription paywall; close it again.
- tapOn:
id: "shop-see-plans"
- extendedWaitUntil:
visible:
id: "paywall-close"
timeout: 30000
- tapOn:
id: "paywall-close"
- extendedWaitUntil:
visible:
id: "shop-screen"
timeout: 15000#subflows/sleep.yaml
appId: ${APP_ID}
---
# Waits ${MS} ms. Maestro has no sleep, and `waitForAnimationToEnd` returns as soon as the screen is
# still: wait for an element that is never there, `optional` so running the clock out is not a failure.
- extendedWaitUntil:
visible:
id: "no-such-element"
timeout: ${MS}
optional: true#subflows/to-song-list.yaml
appId: ${APP_ID}
---
# Reaches the song list after a launch, closing whatever opens over it on its own (a launch paywall, the
# 50% sale, "Learn Mode unlocked!" — dismiss-offers.yaml), so the flow continues from a known screen.
# These can be up BEFORE the list is (Learn Mode covers the whole screen at launch once a seeded
# `e2eSongEnds` count passes 3), so the wait itself keeps closing them: a plain wait for the list would
# time out under one.
- repeat:
times: 40
while:
notVisible:
id: "songs-search-input"
commands:
- runFlow: dismiss-offers.yaml
# Right after a launch: pause.yaml spends the time without asking the XCTest driver for the
# screen (sleep.yaml does, and can hit its 500 while the app is still starting).
- runFlow:
file: pause.yaml
env:
MS: "3000"
- extendedWaitUntil:
visible:
id: "songs-search-input"
timeout: 10000
# One can also open just after the list shows: give it a moment, close it, and be on the list.
- runFlow:
file: sleep.yaml
env:
MS: "3000"
- runFlow: dismiss-offers.yaml
- extendedWaitUntil:
visible:
id: "songs-search-input"
timeout: 30000#subflows/tutorial-free-songs.yaml
appId: ${APP_ID}
---
# The tutorial's free songs on onboarding script 2 (the tutorial area pins it: tutorial/area.env), from a
# clean install: intro -> post-onboarding paywall (closed) -> welcome -> drills -> the choose screen ->
# the song -> its result -> then, by `tutorial.free_songs`:
# ${EXPECT_PICK} "1" (2 free songs, `pick_after_play`): the reward picker offers one more song, the
# flow takes the first; anything else (3 free songs, `grant_all`): no picker, the song list
# Each value is checked against the arm's real config (src/data/__tests__/e2e-monetization-flows.test.ts).
#
# Needs the area's console `tutorial_song` (tutorial/app.env): three mock songs on a bundled excerpt, so
# the run OFFERS three. Without it every slot is the Twinkle stand-in, one card, and every arm ends
# "single" (no picker) — what the first device runs met.
- runFlow: first-run-intro.yaml
- extendedWaitUntil:
visible:
id: "paywall-close"
timeout: 60000
- tapOn:
id: "paywall-close"
- setOrientation: LANDSCAPE_LEFT
- extendedWaitUntil:
visible:
id: "tutorial-welcome-cta"
timeout: 60000
- tapOn:
id: "tutorial-welcome-cta"
# The tap and hold drills, on B3 (the 7th of the 12 white keys C3..G4). Each waits for its own prompt
# (TutorialHandGuide: the hand shows once the note rests on the line) instead of a fixed sleep: on
# script 2 the drill starts later than first-run-tutorial.yaml's 9 s, and a press before the note is
# there is ignored — the run then sat on "Tap the highlighted key" for good.
- extendedWaitUntil:
visible:
id: "tutorial-skip"
timeout: 60000
- extendedWaitUntil:
visible: "Tap the highlighted key"
timeout: 60000
- tapOn:
point: "54%,92%"
- extendedWaitUntil:
visible: "Long press the highlighted key"
timeout: 60000
- longPressOn:
point: "54%,92%"
# A choosing run asks for the song first: take the first card.
- extendedWaitUntil:
visible:
id: "tutorial-choose-cta-.*"
timeout: 20000
optional: true
- runFlow:
when:
visible:
id: "tutorial-choose-cta-.*"
commands:
- tapOn:
id: "tutorial-choose-cta-.*"
index: 0
# The song (the mock chart: C4, E4, G4 hold, D4); it waits on its first tile.
- runFlow:
file: sleep.yaml
env:
MS: "18000"
- tapOn:
point: "25%,92%"
- tapOn:
point: "45%,92%"
- longPressOn:
point: "65%,92%"
- tapOn:
point: "35%,92%"
# What the result does depends on the run's reward plan (TutorialSongResultScreen):
# 2 free songs (`pick_after_play`): the result is the score only, held, then REPLACED by the reward
# picker (`tutorial-reward-cta-<song>`, the two songs not played) — take the first;
# 3 free songs (`grant_all`): the full Game Mode result with its buttons ("Open songs list", "Next
# song") and no picker, however long it stays — leave by "Open songs list".
- runFlow:
when:
true: ${EXPECT_PICK == '1'}
commands:
- extendedWaitUntil:
visible:
id: "tutorial-reward-cta-.*"
timeout: 90000
- tapOn:
id: "tutorial-reward-cta-.*"
index: 0
- runFlow:
when:
true: ${EXPECT_PICK != '1'}
commands:
- extendedWaitUntil:
visible:
id: "session-action-songs"
timeout: 90000
# The picker would replace the score after its hold: wait past it, then say it never came.
- runFlow:
file: sleep.yaml
env:
MS: "10000"
- assertNotVisible:
id: "tutorial-reward-cta-.*"
- assertVisible:
id: "session-action-songs"
- tapOn:
id: "session-action-songs"
# Either way the tutorial is over: reach the song list (a picked song may open its gameplay first).
- runFlow: leave-to-song-list.yaml#subflows/user-opened-paywall.yaml
appId: ${APP_ID}
---
# The paywall a player opens on purpose (landscape): Profile -> go premium.
# ${EXPECT_TRIAL} "1": the price line reads "3 days free, then ..."; anything else: it does not
# Starts from an onboarded install (the launch skips the first run), a free player.
- runFlow: bootstrap-app.yaml
- runFlow: open-profile-paywall.yaml
- runFlow:
file: expect-paywall-trial.yaml
env:
TRIAL_PATTERN: ".*3 days free.*"
EXPECT_TRIAL: ${EXPECT_TRIAL}
- tapOn:
id: "paywall-close"
- extendedWaitUntil:
visible:
id: "profile-go-premium"
timeout: 15000