Console logging not logging variables in Maestro

186 views Asked by At

While debugging API calls I'm making in a script within a Maestro flow, I've discovered that console.log(), which is supported in Maestro as of 1.26.1, doesn't seem to be working as expected - the variable passed in as a second parameter in the example below doesn't log, even if the variable is declared right before the console.log:

const myValue = 'hey'
console.log('My hardcoded value is:', myValue) // only logs 'My hardcoded value is:'

Does anyone know what I'm doing wrong/of a way around this?

2

There are 2 answers

0
Andrew On BEST ANSWER

It turns out that the answer to this lies in, as the docs state,

Maestro supports a minimal subset of vanilla JavaScript APIs

Maestro is running a very limited version of JS, and one of the things that's unsupported is the console.log(msg, obj) syntax of console.log.

So

console.log('My variable', myVariable)

fails, but if you do:

console.log(myVariable)

it works.

(Update: Maestro now has beta support for GraalJS, which may also resolve the issue.)

0
Satbir Kira On

My issue was with the reporter. If you're running in reporter mode, or multiple flows (maestro will put into reporter mode for you), then console logs won't work. So if you need to see console logs, use

maestro test SINGLE_FLOW_NAME.yaml

instead of

maestro test /flows/*