appId: com.edde746.plezy
name: TV hardware media and back keys follow player chrome state

tags:
  - e2e
  - regression
  - tv
  - playback
---
- runFlow: ../subflows/onboard_jellyfin_tv.yaml
- pressKey: "Remote Dpad Center"
- waitForAnimationToEnd:
    timeout: 5000
- runFlow:
    when:
      visible: "(?s)^(Play|Resume).*$"
    commands:
      - pressKey: "Remote Dpad Center"
- extendedWaitUntil:
    visible: "Pause"
    timeout: 30000
- pressKey: "back"
- extendedWaitUntil:
    notVisible: "Pause"
    timeout: 10000
- pressKey: "Remote Media Play Pause"
- extendedWaitUntil:
    visible: "Play"
    timeout: 10000
- pressKey: "Remote Media Play Pause"
- extendedWaitUntil:
    visible: "Pause"
    timeout: 10000
- pressKey: "back"
- extendedWaitUntil:
    notVisible: "Pause"
    timeout: 10000
- assertNotVisible: "Overview"
- pressKey: "back"
- waitForAnimationToEnd:
    timeout: 5000
- runFlow:
    when:
      visible: "Overview"
    commands:
      - pressKey: "back"
- extendedWaitUntil:
    visible:
      id: "tv_browse_rail_selection"
    timeout: 15000
