appId: ${APP_ID}
---
# Receive document fragment - assumes user is already in a chat conversation
# Note: This fragment only runs on Android
- runFlow:
    when:
      platform: android
    commands:
      # First to download the document
      - assertVisible: .*document\.pdf.*
      - assertVisible: .*Download.*
      - tapOn: .*document\.pdf.*
      # Verify document is downloaded
      - assertNotVisible: .*Loading...*
      - assertVisible: .*File downloaded.*
      # Then to open the document
      - tapOn: .*document\.pdf.*
      - waitForAnimationToEnd:
          timeout: 2000
      # Verify PDF reader is open by checking for common PDF viewer elements
      # Share and Print buttons are common to both iOS and Android PDF viewers
      - assertVisible: .*(Share|Back|Print|Done|More).*
      - tapOn: Back
