maestro icon indicating copy to clipboard operation
maestro copied to clipboard

[Maestro 1.36.0] console.log statements not output to terminal from runScript commands within flows

Open mattrlong opened this issue 4 months ago • 0 comments

Describe the bug When executing JavaScript files before a flow is executed, the log statements appear as expected in the terminal, ie:

appId: ${APP_ID}
---
- runScript:
    file: ./script.js

- runFlow: "myFlow.yaml" 

However, if the same file is executed within the flow, ie if myFlow.yaml above were to contain:

appId: ${APP_ID}

---

- launchApp:
    clearState: true
- runScript: 
    file: ./script.js

Any log statements within the scripts do not appear in the terminal.

To Reproduce Create script.js with below, and replicate using the two options for executing the script above:

// script.js

const myVar = 'foo';
console.log(myVar); // outputs 'foo'
console.log(`myVar is ${myVar}`) // outputs 'myVar is foo'

Expected behavior console.log output to always appear in the terminal when running flow for debugging purposes.

Screenshots An example of the difference in output can be seen below, where the script.js is executed once before the flow (with output), and the second during a flow execution: image

Environment information (please complete the following information):

  • Maestro version v1.36.0
  • Platform: Android 14
  • Framework: Native Android
  • Device model and OS version: Pixel3a
  • Emulator
  • Host Mac M1
  • RhinoJS runtime

Workspace (if applicable) Please share your workspace with Flow files and application binary if you are able to do so as that greatly helps in reproduction efforts.

Bugreport output (if applicable) The zip files created when maestro bugreport can be uploaded here as well if applicable.

Additional context Add any other context about the problem here.

mattrlong avatar Apr 02 '24 14:04 mattrlong