You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and didn't find mine.
Steps to reproduce
Test file
appId: test
jsEngine: graaljs
---
- runScript: script-error.js
test script
console.log(`${Date.now()} hello`);
throw new Error('This is an error');
Run test with maestro test test-error.yaml
Actual results
Error message is displayed console. Console.log is not seen.
Expected results
Error message is displayed console. Console.log output should be visible somewhere
About app
no app
About environment
java -version
openjdk version "21.0.4" 2024-07-16 LTS
OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode)
OSX 14.7 Sonoma arm64
Logs
Logs
Error: This is an error
at <js> :program(script-error.js:2:42-70)
at org.graalvm.polyglot.Context.eval(Context.java:399)
at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:70)
at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:22)
at maestro.orchestra.Orchestra.runScriptCommand(Orchestra.kt:419)
at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:279)
at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:191)
at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:127)
at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:200)
at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:61)
at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:53)
at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:155)
at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:53)
at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:306)
at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:258)
at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:102)
at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:54)
at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:258)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
==== Debug output (logs & screenshots) ====
Once an error is thrown in JS then there is no way to get any other console.logs produced by JS. This is a pain when debugging.
The console output is deleted and replaced by the error.
None of the output files have the JS console.log() outputs in them
The workaround is to comment out code that is causing the error, debug and then put the code back in again when fixed, which is painful.
I've also tried maestro test test-error.yaml > out.txt maestro test test-error.yaml > out.txt 2>&1
none of these options gets me the error and the console.logs at the same time.
Suggested fix:
add the JS output to the maestro.log
don't replace the console output with errors from JS, just stop the test and append any errors
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Steps to reproduce
Test file
test script
Run test with
maestro test test-error.yaml
Actual results
Error message is displayed console. Console.log is not seen.
Expected results
Error message is displayed console. Console.log output should be visible somewhere
About app
no app
About environment
OSX 14.7 Sonoma arm64
Logs
Logs
maestro.log
Maestro version
1.38.1
How did you install Maestro?
install script (https://get.maestro.mobile.dev)
Anything else?
Once an error is thrown in JS then there is no way to get any other console.logs produced by JS. This is a pain when debugging.
The workaround is to comment out code that is causing the error, debug and then put the code back in again when fixed, which is painful.
I've also tried
maestro test test-error.yaml > out.txt
maestro test test-error.yaml > out.txt 2>&1
none of these options gets me the error and the console.logs at the same time.
Suggested fix:
The text was updated successfully, but these errors were encountered: