appId: ${APP_ID}
env:
  USERNAME: foo.bar@example.com
---
# Note: This flow only runs on Android
- runFlow:
    when:
      platform: android
    commands:
      - runFlow: ../../../shared/launch-app.yml
      - runFlow: ../../../shared/login-to-community.yml
      - tapOn: Chats
      - runFlow: ../../../shared/handle-bottom-sheet.yml
      - assertVisible: .*John Doe.*
      - tapOn: .*John Doe.*

      - tapOn: .*Add Attachments.*
      - tapOn:
          point: 30%,80%
      - waitForAnimationToEnd:
          timeout: 2000
      - runFlow: ../../../shared/pick-asset/pick-a-document.yml
      - extendedWaitUntil:
          visible: document.pdf, Uploaded
          timeout: 15000
      - assertVisible: .*Remove.*
      - assertVisible: document\.pdf
      - assertVisible: \d+\.\d+ KB • PDF
      - tapOn: Send
      - runScript: ../scripts/getTime.js
      - assertVisible: 'You, document.pdf, ${output.time}, Sent'
