runFlow command's path argument doesn't allow for interpolation of JavaScript values
Use case
It should be simpler to Maestro read variable values. For example, for aesthetic and organizational reasons, I want to access flows that are in another folder. So I have to write
- runFlow: ...Ubuntu\home\ana\app-syndic-automation\tests\login.yaml
- runFlow:...Ubuntu\home\ana\app-syndic-automation\flows\subflows\accessPixComponent.yaml
- runFlow:...Ubuntu\home\ana\app-syndic-automation\flows\subflows\accessPixKeyArea.yaml
This visually looks ugly and gives an impression of disorganization. So I didn't sit still until I found a way to do it, having to write a variable processing script in python. See, something that seems so simple, I had to make a SCRIPT for it.
And this is how it is now:
- runFlow: {{ LOGIN }}/login.yaml
- runFlow: {{ CONDOMINIUM }}/accessPixComponent.yaml
- runFlow: {{ CONDOMINIUM }}/accessPixKeyArea.yaml
So my suggestion is to find an easier way to do this.
Proposal
Anything else?
No response
Hey @AnaLuisaFav 👋🏻 Thanks for taking time to share this feature request with us.
I thought you could already do something similar with JavaScript and output object, but turns out it's not possible.
.maestro/demo.yaml
appId: com.example.example
---
- launchApp:
- runScript: setVars.js
- runFlow: ${output.FLOW_DIR}/fill_form.yaml
.maestro/setVars.js
output.FLOW_DIR = './my/very/deep/dir/structure'
.maestro/my/very/deep/dir/structure/fill_form.yaml
appId: com.example.example
---
- launchApp
It fails with:
$ maestro test .maestro/demo.yaml
Failed to parse file: /Users/bartek/projects/maestro/e2e/workspaces/demo_app/demo.yaml
Flow file does not exist: file:///Users/bartek/projects/maestro/e2e/workspaces/demo_app/$%7Boutput.FLOW_DIR%7D/fill_form.yaml
I'm gonna change title to make it possibe to allow JS variables interpolation within runFlow's path argument.
I also need this, implementation would be much appreciated!
#1314 requests the same but for environment variables. Essentially it's one feature request. I'm also interested in this
I'm assuming this would apply to commands like startRecording so we can interpolate env vars as well. Thanks for taking this on!
Yeah, and same with runScript as well!
I'd love this as well