maestro icon indicating copy to clipboard operation
maestro copied to clipboard

[Feature Request] - Compose Multiplatform

Open GuilhE opened this issue 10 months ago • 2 comments

Is your feature request related to a problem? Please describe. Adding support for Compose Multiplatform would be a valuable enhancement, especially considering JetBrains's significant investment in it.

Describe the solution you'd like Same functionality we have when using Jetpack Compose and Swift UI:

  • Faster evaluation time
  • Possibility to distinguish widgets on Maestro Studio
  • Stability

Additional context You can test it by running my sample and compare the time it takes to evaluate for instance:

  • assertVisible: Stand by
  • tapOn: point: 50%,81% (the simulator gets the command but the Studio does not stream)

using Maestro Studio on Swift UI and Compose screen with an iOS Simulator. I'm also experiencing random crashs when navigating between screens when Maestro Studio is connected with the iOS Simulator:

Navigate to http://localhost:9999 in your browser to open Maestro Studio. Ctrl-C to exit.
io.ktor.util.cio.ChannelWriteException: Cannot write to a channel
        at io.ktor.server.netty.cio.NettyHttpResponsePipeline.respondWithFailure(NettyHttpResponsePipeline.kt:102)
        at io.ktor.server.netty.cio.NettyHttpResponsePipeline.respondWithBodyAndTrailerMessage(NettyHttpResponsePipeline.kt:252)
        at io.ktor.server.netty.cio.NettyHttpResponsePipeline.access$respondWithBodyAndTrailerMessage(NettyHttpResponsePipeline.kt:26)
        at io.ktor.server.netty.cio.NettyHttpResponsePipeline$respondWithBodyAndTrailerMessage$1.invokeSuspend(NettyHttpResponsePipeline.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:291)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: io.netty.channel.StacklessClosedChannelException
        at io.netty.channel.AbstractChannel$AbstractUnsafe.write(Object, ChannelPromise)(Unknown Source)
        Error: Request for viewHierarchy failed, because of app crash, body: {"errorMessage":"Error getting main window kAXErrorCannotComplete","code":"internal"}
maestro.MaestroException$AppCrash: App crashed or stopped while executing flow, please check diagnostic logs: ~/Library/Logs/DiagnosticReports directory
        at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:482)
        at maestro.drivers.IOSDriver.contentDescriptor(IOSDriver.kt:142)
        at maestro.ViewHierarchy$Companion.from-c1iYVAs(ViewHierarchy.kt:29)
        at maestro.Maestro.viewHierarchy-prqvCes(Maestro.kt:405)
        at maestro.studio.DeviceService.getDeviceScreen(DeviceService.kt:172)
        at maestro.studio.DeviceService.access$getDeviceScreen(DeviceService.kt:43)
        at maestro.studio.DeviceService$routes$3$1.invokeSuspend(DeviceService.kt:82)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)


To replicate:

  1. Tap on COMPOSE
  2. Tap on Back
  3. repeat until it crashes

When the Maestro Studio is not connected it will not crash.

GuilhE avatar Oct 24 '23 16:10 GuilhE