appId: com.edde746.plezy
env:
  PREFIX: ./${maestro.platform}/
---
- evalScript: ${output.suffix = '-' + Date.now().toString()}
- launchApp:
    clearState: true
    stopApp: false
- runFlow: auth.yaml
- assertVisible:
    id: "media-hero-${MAESTRO_EPISODE}"
- tapOn: "Pause auto-scroll"
- waitForAnimationToEnd
- tapOn:
    text: "Play auto-scroll"
    waitToSettleTimeoutMs: 800
- takeScreenshot: "${PREFIX}1-home${output.suffix}"
- tapOn: "Libraries.*"
- tapOn:
    text: "TV Shows"
    waitToSettleTimeoutMs: 200
- runFlow:
    when:
      true: ${MAESTRO_COLLECTION != ""}
    commands:
      - tapOn: "Filters"
      - tapOn: "Collection"
      - tapOn: "${MAESTRO_COLLECTION}"
- repeat:
    while:
      visible: "skeleton-loader"
    commands:
      - assertNotVisible: "skeleton-loader"

- takeScreenshot: "${PREFIX}2-library${output.suffix}"
- scrollUntilVisible:
    element:
      id: "media-card-${MAESTRO_SHOW}"
- tapOn:
    id: "media-card-${MAESTRO_SHOW}"
- waitForAnimationToEnd:
    timeout: 5000
- takeScreenshot: "${PREFIX}3-media-card${output.suffix}"
- scrollUntilVisible:
    element:
      id: "media-season-.*"
- tapOn:
    id: "media-season-.*"
- takeScreenshot: "${PREFIX}4-season${output.suffix}"
