mobile-dev-inc/maestro

[Feature Request] Can we have print statement in flow yaml

Opened this issue · 3 comments

Is your feature request related to a problem? Please describe.
The problem is that we can not put logs after steps if it did passed or failed on console while running through tests folder where multiple flow files exist.
For example we use :
console.log("XYZ step passed")

Describe the solution you'd like
Something similar to console.log which accept string and print as it is.

I was hunting around for another hobby contribution, but I'm not sure I fully understand this.

we can not put logs after steps if it did passed or failed on console

Are you talking about being able to log something after the flow has already failed?

you can use evalScript

- evalScript: ${console.log('Hello Word')}

it's stated here https://maestro.mobile.dev/api-reference/commands/runscript#console-logging

@rasyid7 this is being executed as javascript..not sure if we can simply print something in yaml. While running tests via folder this print via evalScript is not shown on console. It only shows the element due to which test fail. no print statement before that because this is a action for maestro to execute javascript.

To add more details
Lets say there are 10 lines of action in yaml and I am running tests via flows folder(where it contains all the test flows)
After 5th I have added evalScript to print that line 5th executed. If it failed on line 7th action due to any locator etc issue - console will not show the print on 5th it will show the fail on 7th with locator.