appId: com.edde746.plezy
name: Download and play a movie from Downloads

tags:
  - e2e
  - downloads
  - playback
---
- runFlow: ../subflows/onboard_jellyfin.yaml
- tapOn: "(?s)^Libraries.*"
- tapOn: "Browse"
- extendedWaitUntil:
    visible: "(?s).*Alpha Archive.*"
    timeout: 15000
- tapOn: "(?s).*Alpha Archive.*"
- extendedWaitUntil:
    visible: "Overview"
    timeout: 15000
- tapOn: "Download"
- runFlow:
    when:
      platform: iOS
    commands:
      - tapOn:
          point: "6%, 9%"
- runFlow:
    when:
      platform: Android
    commands:
      - back
- extendedWaitUntil:
    visible: "Maestro Movies"
    timeout: 10000
- tapOn: "(?s)^Downloads.*"
- tapOn:
    text: "Movies"
    waitToSettleTimeoutMs: 3000
- extendedWaitUntil:
    visible: "(?s).*Alpha Archive.*"
    timeout: 60000
- runScript:
    file: ../scripts/set_jellyfin_offline.js
    env:
      JELLYFIN_CONTROL_URL: ${JELLYFIN_CONTROL_URL}
- waitForAnimationToEnd:
    timeout: 3000
- tapOn: "(?s).*Alpha Archive.*"
- extendedWaitUntil:
    visible: "Overview"
    timeout: 15000
- tapOn:
    text: "Play"
    waitToSettleTimeoutMs: 1000
- extendedWaitUntil:
    visible: "Pause"
    timeout: 30000
- runFlow:
    when:
      platform: iOS
    commands:
      - tapOn:
          point: "90%, 5%"
      - extendedWaitUntil:
          visible: "Overview"
          timeout: 10000
- runFlow:
    when:
      platform: Android
    commands:
      - back
      - extendedWaitUntil:
          notVisible: "Pause"
          timeout: 10000
      - back
      - extendedWaitUntil:
          visible: "Overview"
          timeout: 10000
