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
When attempting to use the setTimeout function in a JavaScript file (test.js) executed by Maestro using the GraalJS engine, the following error occurs:
TypeError: undefined is not a function
at <js> :program(test.js:1-3:0-66)
I also tried this example here but I received the same error.
1 - Create a script:
setTimeout(() => {
console.log("Delayed for 1 second.");
}, 1000);
3- Run the command: maestro test .maestro/test/test.yaml
I also tried to force the environment: export MAESTRO_USE_GRAALJS=true
But it seems to didn't affect anything.
Actual results
I received this error:
TypeError: undefined is not a function
at <js> :program(test.js:1-3:0-66)
at org.graalvm.polyglot.Context.eval(Context.java:399)
at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:73)
at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:24)
at maestro.orchestra.Orchestra.runScriptCommand(Orchestra.kt:447)
at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:296)
at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:197)
at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:131)
at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:179)
at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:62)
at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:53)
at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:160)
at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:53)
at maestro.cli.command.TestCommand.runSingleFlow(TestCommand.kt:352)
at maestro.cli.command.TestCommand.access$runSingleFlow(TestCommand.kt:63)
at maestro.cli.command.TestCommand$runShardSuite$2.invoke(TestCommand.kt:326)
at maestro.cli.command.TestCommand$runShardSuite$2.invoke(TestCommand.kt:297)
at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:103)
at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:53)
at maestro.cli.command.TestCommand.runShardSuite(TestCommand.kt:297)
at maestro.cli.command.TestCommand.access$runShardSuite(TestCommand.kt:63)
at maestro.cli.command.TestCommand$handleSessions$1$results$1$1.invokeSuspend(TestCommand.kt:265)
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)
Expected results
I expect no errors and the text Delayed for 1 second. on the console.
setTimeout is a node feature, or a browser feature. It's not part of the ECMAScript specification. GraalVM folks are pretty picky on that.
We'd love to upgrade and reconfigure graaljs to support additional Node and JS things, but doing so would cut off some Java versions, and that would upset a lot of folks.
That being said, I bet there's a contribution someone could make that would open up some additional support in the current version - it just needs someone with sufficient motivation to dig into it.
Is there an existing issue for this?
Steps to reproduce
When attempting to use the setTimeout function in a JavaScript file (test.js) executed by Maestro using the GraalJS engine, the following error occurs:
I also tried this example here but I received the same error.
1 - Create a script:
2 - Create the yaml:
3- Run the command:
maestro test .maestro/test/test.yaml
I also tried to force the environment:
export MAESTRO_USE_GRAALJS=true
But it seems to didn't affect anything.
Actual results
I received this error:
Expected results
I expect no errors and the text
Delayed for 1 second.
on the console.About app
The app information on this isn't necessary
About environment
Java version: openjdk 17.0.13 2024-10-15
Ubuntu 22.04.5
x86_64
Logs
Logs
Maestro version
1.39.7
How did you install Maestro?
install script (https://get.maestro.mobile.dev)
Anything else?
No response
The text was updated successfully, but these errors were encountered: