maestro icon indicating copy to clipboard operation
maestro copied to clipboard

addMedia not showing in Gallery on Android Cloud

Open milesingrams opened this issue 1 year ago • 2 comments
trafficstars

Describe the bug

when using addMedia to add a file it works locally but in the cloud the action succeeds but doesnt show any images in the gallery on Android.

To Reproduce Steps to reproduce the behavior, e.g.:

  1. Run on Android Maestro Cloud
    • addMedia
    • open gallery

Expected behavior Images should show in gallery after adding media

Screenshots Empty Gallery: Screen Shot 2024-03-28 at 1 11 43 PM

Environment information (please complete the following information):

  • Maestro version: Cloud
  • Platform: Analyzed using Android API level 30
  • Framework: Expo v49
  • Device model and OS version: Default cloud version of Android
  • Simulator, emulator or physical device
  • Host: Cloud

Workspace (if applicable) Flow file truncated:

test.yml

- addMedia:
    - '../assets/test.png'
- runFlow:
    file: '../shared/select-gallery-image.yml'

select-gallery-image.yml:

- runFlow:
    when:
      platform: Android
    commands:
      - tapOn:
          id: 'com.google.android.documentsui:id/icon_thumb'
- runFlow:
    when:
      platform: iOS
    commands:
      - tapOn: 'Photo,.*'

milesingrams avatar Mar 28 '24 17:03 milesingrams

Same for iOS.

I've reported it on the slack and had this response at 05 Feb 2024:

unfortunately there is no easy fix here, and will require more time investigating. Since we have a backlog of issues and limited resources I won't be able to give you an ETA, we're sorry for the inconvenience.

In our app, our most used feature is file upload and we cannot test it... it's critical for us and the team seems to ignore this. I'm starting to wonder we're not going to withdraw from the cloud...

Carl-MONNERA avatar Apr 03 '24 12:04 Carl-MONNERA

Any update on this?

Hosam-hsm avatar May 23 '24 04:05 Hosam-hsm

I was not able to reproduce this issue on Android.

Workspace

$ tree .maestro
.maestro
├── assets
│   └── image.png
├── issue1706.yaml
image.png

Just some random screenshot I had at hand.

image

Test flow

appId: com.example.example
name: Issue 1706
---
- launchApp:
    clearState: true
- addMedia:
  - assets/image.png
- launchApp: com.google.android.documentsui
- tapOn: Show roots
- tapOn: Images
- tapOn: Pictures
- assertVisible: image.png
- longPressOn: image.png
- tapOn: Search # wtf? this actually taps on "Delete" icon
- tapOn: OK
- assertNotVisible: image.png

Command used to run

$ maestro cloud \                                                                                            exit 130
  --android-api-level 33 \
  build/app/outputs/apk/debug/app-debug.apk \
  .maestro

Recording from Maestro Cloud

Recording from Maestro cloud

https://github.com/user-attachments/assets/2c196cdd-4fde-4d71-8fcb-db2fe18a12a8

Environment information

  • macOS 14.5 Sonoma
  • Maestro CLI v1.36.0

bartekpacia avatar Jul 19 '24 12:07 bartekpacia

After further investigation, I was still not able to reproduce this problem [^1].

It may sound funny, but I believe this is a misunderstanding. The screenshot in the OP shows File Explorer open on the "Recent" tab – but even if the image is added with addMedia, it will not show in the "Recent" tab. You have to open that image at least once, only then it'll show in "Recent". You have to go to Images > Pictures and there your image should be.

Please see video attached:

https://github.com/user-attachments/assets/b0e49d0e-44b7-4007-884b-55563a7d5b8b

Flow
appId: com.example.example
name: Issue 1706 
---
- launchApp:
    clearState: true
- addMedia:
  - assets/image.png
- launchApp: com.android.documentsui
  # "com.android.documentsui" for API 29 and below
  # "com.google.android.documentsui" for API 30 and above
- tapOn: Show roots
- tapOn: Images
- tapOn: Pictures
- assertVisible: image.png
- longPressOn: image.png
- tapOn: Search # wtf?
- tapOn: OK
- assertNotVisible: image.png

If you experience any more problems with addMedia, please create a new issue. This one is not reproducible and I'm going to close it.

[^1]: I found that addMedia crashed on API 28, but this is a different issue. I created #1821 to track it.

bartekpacia avatar Jul 23 '24 10:07 bartekpacia

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!

github-actions[bot] avatar Jul 30 '24 11:07 github-actions[bot]

Some more notes:

testing addMedia on android api levels:

  • 28 #1821
  • 29 :warning: Unable to launch app com.google.android.documentsui: Package com.google.android.documentsui is not installed
  • 30 :white_check_mark: [Failed] Issue 1706 (5m 54s) (Element not found: Text matching regex: OK) but file is there
  • 31 :white_check_mark:
  • 32 not supported
  • 33 :white_check_mark:
  • 34 :white_check_mark:

bartekpacia avatar Aug 19 '24 21:08 bartekpacia