maestro icon indicating copy to clipboard operation
maestro copied to clipboard

[1.36.0] `addMedia` does not resolve path consistently based on execution context

Open greeeg opened this issue 1 year ago • 1 comments

Describe the bug

I have a project folder structure like this:

.
├── e2e
│   ├── output
│   ├── assets
│   ├── scenarios
│   ├── scripts
│   └── utils

Assets contains medias I'm using with addMedia in my scenarios:

# e2e/scenarios/my-scenario.yaml
appId: com.example
name: Attach a receipt to a transaction
---
- addMedia:
    - '../assets/sample-receipt.jpg'

When running maestro test ./e2e/scenarios/my-scenario.yaml, everything works as expected, but when I run maestro test e2e/scenarios, the relative path does not work. I could only make it work by moving the assets folder within the scenarios folder.

I would expect this to work in both contexts, or the notion of Maestro workspace needs to be clarified

Environment information (please complete the following information):

  • Maestro version: 1.36.0
  • Platform: Android
  • Framework: React Native
  • Simulator
  • Mac M3

greeeg avatar Mar 29 '24 09:03 greeeg

Any update regarding this issue?

mskhan18 avatar May 02 '24 12:05 mskhan18

Hey @greeeg, thanks for reporting this bug - I reproduced it.

Directory hierarchy:

.maestro
├── assets
│   └── image.png
├── assets_example
│   └── flow.yaml

Flow:

appId: com.example.example
---
- launchApp
- addMedia:
    - ../assets/image.png

Works (as it should)

maestro test .maestro/assets_example/flow.yaml

Does not work (but should work)

maestro test .maestro/assets_example

Error: The File "image.png" referenced in flow file: /Users/bartek/projects/demo_app/.maestro/assets_example/flow.yaml not found in workspace

bartekpacia avatar Aug 15 '24 21:08 bartekpacia