For AI agents: the complete documentation index is available at ../../../llms.txt, the full documentation bundle is available at ../../../llms-full.txt, and this page is available as Markdown at ../../../quality/scripts/subflows/noads-popup-cycle.md.

subflows/noads-popup-cycle.yaml

Source

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}