mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.7k stars 260 forks source link

Runner crashes under Xcode 16 #1894

Closed freak4pc closed 3 weeks ago

freak4pc commented 1 month ago

Is there an existing issue for this?

Steps to reproduce

For me simply having any kind of project with a text input and inputText command reproduces the issue

Actual results

When getting to an input field and trying to use inputText to type, the runner retries a few times and then crashes. This reproduces constantly for us.

image

Expected results

Simply type as it used to in Xcode 15.x

About app

Native. Mix of UIKit and SwiftUI. iOS 16 deployment target.

About environment

Xcode 16.x on any MacBook (macOS Sequoia)

Logs

Logs ``` Running on iPhone 15 Pro - iOS 17.5 - A5D1F2DB-FE3F-430F-AC14-EB3883AA8A7F ║ ║ > Flow ║ ║ ✅ Launch app "com.monday.monday" ║ ⏳ Run ../../actions/login/login.yaml when "Log in" is visible ║ ✅ Launch app "com.monday.monday" without stopping app ║ ✅ Tap on "Log in" ║ ✅ Tap on "Enter your email address" ║ ⏳ Input text mobile.e2e@monday.com ║ 🔲 Tap on "Continue with email" ║ 🔲 Tap on ".*More login options" ║ 🔲 Tap on "Log in with your password" ║ 🔲 Tap on "Enter your password" ║ 🔲 Input text ${MAESTRO_E2E_PASSWORD} ║ 🔲 Tap on "Log in" ║ 🔲 Run ../../actions/home/create_new_board.yaml ║ 🔲 Run ../../actions/board/rename_board.yaml ║ 🔲 Tap on "item 1" ║ 🔲 Tap on id: itemMenuButton ║ 🔲 Tap on "Duplicate.*" ║ 🔲 Assert that "Item 1 (copy)" is visible ║ 🔲 Tap on "close" ║ 🔲 Assert that "Item 1 (copy)" is visible ║ 🔲 Tap on "item 1" ║ 🔲 Tap on "item 1" ║ 🔲 Input text renamed ║ 🔲 Tap on "done" ║ 🔲 Assert that "item 1 renamed" is visible ║ 🔲 Tap on "close" ║ 🔲 Assert that "item 1 renamed" is visible ║ 🔲 Tap on "item 1 renamed" ║ 🔲 Tap on id: itemMenuButton ║ 🔲 Tap on "Edit name" ║ 🔲 Input text again ║ 🔲 Tap on "done" ║ 🔲 Assert that "item 1 renamed again" is visible ║ 🔲 Tap on "close" ║ 🔲 Assert that "item 1 renamed again" is visible ║ 🔲 Tap on id: boardGridActionButton ║ 🔲 Tap on "New Group" ║ 🔲 Input text Target group ║ 🔲 Tap on "Add group" ║ 🔲 Tap on "item 1 renamed again" ║ 🔲 Tap on id: itemMenuButton ║ 🔲 Tap on "Move to group" ║ 🔲 Tap on "Target group" ║ 🔲 Tap on "close" ║ 🔲 Assert that "item 1 renamed again", Below "Target group" is visible ║ 🔲 Tap on id: navigationAction.back ║ 🔲 Tap on id: navigationAction.search ║ 🔲 Input text ${output.boardName.random} ║ 🔲 Tap on "${output.boardName.random}", Below "${output.boardName.random}" ║ 🔲 Assert that "item 1 renamed again", Below "Target group" is visible ║ ℹ️ Retrying connection to the XCUITest server for 1... ℹ️ Retrying connection to the XCUITest server for 2... ℹ️ Retrying connection to the XCUITest server for 3... ℹ️ Retrying connection to the XCUITest server for 4... ℹ️ Retrying connection to the XCUITest server for 5... Error: ⚠️ Error: An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance. ⚠️ Error: An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance. Error: Request for inputText failed, because of XCUITest server got crashed/exit, body: {"errorMessage":"An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.","code":"network-error"} ℹ️ Retrying connection to the XCUITest server for 1... ❌ Error: BlockingCoroutine is cancelling kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@7c0692f4 Caused by: NetworkError(errorResponse=Request for inputText failed, because of XCUITest server got crashed/exit, body: {"errorMessage":"An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.","code":"network-error"}) at xcuitest.XCTestDriverClient.handleExceptions(XCTestDriverClient.kt:280) at xcuitest.XCTestDriverClient.processResponse(XCTestDriverClient.kt:258) at xcuitest.XCTestDriverClient.executeJsonRequest(XCTestDriverClient.kt:240) at xcuitest.XCTestDriverClient.inputText(XCTestDriverClient.kt:152) at ios.xctest.XCTestIOSDevice$input$1.invoke(XCTestIOSDevice.kt:119) at ios.xctest.XCTestIOSDevice$input$1.invoke(XCTestIOSDevice.kt:117) at ios.xctest.XCTestIOSDevice.execute(XCTestIOSDevice.kt:227) at ios.xctest.XCTestIOSDevice.input(XCTestIOSDevice.kt:117) at ios.LocalIOSDevice.input(LocalIOSDevice.kt:82) at maestro.drivers.IOSDriver$inputText$1.invoke(IOSDriver.kt:388) at maestro.drivers.IOSDriver$inputText$1.invoke(IOSDriver.kt:388) at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:499) at maestro.drivers.IOSDriver.inputText(IOSDriver.kt:388) at maestro.Maestro.inputText(Maestro.kt:480) at maestro.orchestra.Orchestra.inputTextCommand(Orchestra.kt:752) at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:259) at maestro.orchestra.Orchestra.executeSubflowCommands(Orchestra.kt:605) at maestro.orchestra.Orchestra.runSubFlow(Orchestra.kt:646) at maestro.orchestra.Orchestra.runFlowCommand(Orchestra.kt:514) at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:270) at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:201) at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:111) at maestro.orchestra.Orchestra.runFlow$default(Orchestra.kt:75) at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:185) at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:54) at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:51) at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:145) at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:51) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:291) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:249) at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:106) at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:249) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) ```

Maestro version

1.37.7

How did you install Maestro?

other (please specify in the text area below)

Anything else?

Installed using asdf / mise

yobelioekaharja commented 1 month ago

I also got the exactly the same error using Xcode 13.x

gagtic commented 1 month ago

Getting same issue in XCode 15.1

Maestro version: 1.37.9

Log dump

[INFO ] MAESTRO - ---- System Info ----
[INFO ] MAESTRO - Maestro Version: 1.37.9
[INFO ] MAESTRO - CI: Undefined
[INFO ] MAESTRO - OS Name: Mac OS X
[INFO ] MAESTRO - OS Version: 14.1
[INFO ] MAESTRO - Architecture: aarch64
[INFO ] MAESTRO - Java Version: 0
[INFO ] MAESTRO - Xcode Version: 15.1
[INFO ] MAESTRO - Flutter Version: Undefined
[INFO ] MAESTRO - Flutter Channel: Undefined
[INFO ] MAESTRO - ---------------------
[INFO ] xcuitest.XCTestDriverClient - [Start] Uninstalling xctest ui runner app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Done] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Start] Uninstall XCUITest runner
[INFO ] util.CommandLineUtils - Running command line operation: [xcrun, simctl, uninstall, 866D3CE2-D726-45DF-8FD0-A9284C0A18C0, dev.mobile.maestro-driver-iosUITests.xctrunner]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Uninstall XCUITest runner
[INFO ] xcuitest.XCTestDriverClient - [Done] Uninstalling xctest ui runner app
[INFO ] xcuitest.XCTestDriverClient - [Start] Installing xctest ui runner app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Done] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Start] Uninstall XCUITest runner
[INFO ] util.CommandLineUtils - Running command line operation: [xcrun, simctl, uninstall, 866D3CE2-D726-45DF-8FD0-A9284C0A18C0, dev.mobile.maestro-driver-iosUITests.xctrunner]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Uninstall XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Start] Install XCUITest runner on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing xctest run file
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing xctest run file
[INFO ] x.installer.LocalXCTestInstaller - Not able to find ui test runner app running, going to install now
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing maestro-driver-iosUITests-Runner app
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing maestro-driver-iosUITests-Runner app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing maestro-driver-ios app
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing maestro-driver-ios app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Running XcUITest with xcode build command
[INFO ] util.CommandLineUtils - Running command line operation: [xcodebuild, test-without-building, -xctestrun, /var/folders/2w/rx0jd6x90nd9bqsxwbxmvwww0000gn/T/866D3CE2-D726-45DF-8FD0-A9284C0A18C0/maestro-driver-ios-config.xctestrun, -destination, id=866D3CE2-D726-45DF-8FD0-A9284C0A18C0, -derivedDataPath, /var/folders/2w/rx0jd6x90nd9bqsxwbxmvwww0000gn/T/maestro_xctestrunner_xcodebuild_output3452217944125802786]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Running XcUITest with xcode build command
[INFO ] x.installer.LocalXCTestInstaller - [Done] Install XCUITest runner on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Ensure XCUITest runner is running on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Done] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Start] Uninstall XCUITest runner
[INFO ] util.CommandLineUtils - Running command line operation: [xcrun, simctl, uninstall, 866D3CE2-D726-45DF-8FD0-A9284C0A18C0, dev.mobile.maestro-driver-iosUITests.xctrunner]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Uninstall XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Failed] Ensure XCUITest runner is running on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Retry] Retrying setup() 0th time
[INFO ] x.installer.LocalXCTestInstaller - [Start] Install XCUITest runner on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing xctest run file
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing xctest run file
[INFO ] x.installer.LocalXCTestInstaller - Not able to find ui test runner app running, going to install now
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing maestro-driver-iosUITests-Runner app
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing maestro-driver-iosUITests-Runner app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing maestro-driver-ios app
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing maestro-driver-ios app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Running XcUITest with xcode build command
[INFO ] util.CommandLineUtils - Running command line operation: [xcodebuild, test-without-building, -xctestrun, /var/folders/2w/rx0jd6x90nd9bqsxwbxmvwww0000gn/T/866D3CE2-D726-45DF-8FD0-A9284C0A18C0/maestro-driver-ios-config.xctestrun, -destination, id=866D3CE2-D726-45DF-8FD0-A9284C0A18C0, -derivedDataPath, /var/folders/2w/rx0jd6x90nd9bqsxwbxmvwww0000gn/T/maestro_xctestrunner_xcodebuild_output3399633977470757523]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Running XcUITest with xcode build command
[INFO ] x.installer.LocalXCTestInstaller - [Done] Install XCUITest runner on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Ensure XCUITest runner is running on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Done] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Start] Uninstall XCUITest runner
[INFO ] util.CommandLineUtils - Running command line operation: [xcrun, simctl, uninstall, 866D3CE2-D726-45DF-8FD0-A9284C0A18C0, dev.mobile.maestro-driver-iosUITests.xctrunner]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Uninstall XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Failed] Ensure XCUITest runner is running on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Retry] Retrying setup() 1th time
[INFO ] x.installer.LocalXCTestInstaller - [Start] Install XCUITest runner on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing xctest run file
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing xctest run file
[INFO ] x.installer.LocalXCTestInstaller - Not able to find ui test runner app running, going to install now
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing maestro-driver-iosUITests-Runner app
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing maestro-driver-iosUITests-Runner app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Writing maestro-driver-ios app
[INFO ] x.installer.LocalXCTestInstaller - [Done] Writing maestro-driver-ios app
[INFO ] x.installer.LocalXCTestInstaller - [Start] Running XcUITest with xcode build command
[INFO ] util.CommandLineUtils - Running command line operation: [xcodebuild, test-without-building, -xctestrun, /var/folders/2w/rx0jd6x90nd9bqsxwbxmvwww0000gn/T/866D3CE2-D726-45DF-8FD0-A9284C0A18C0/maestro-driver-ios-config.xctestrun, -destination, id=866D3CE2-D726-45DF-8FD0-A9284C0A18C0, -derivedDataPath, /var/folders/2w/rx0jd6x90nd9bqsxwbxmvwww0000gn/T/maestro_xctestrunner_xcodebuild_output5620819362246648276]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Running XcUITest with xcode build command
[INFO ] x.installer.LocalXCTestInstaller - [Done] Install XCUITest runner on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Ensure XCUITest runner is running on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Start] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Done] Stop XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Start] Uninstall XCUITest runner
[INFO ] util.CommandLineUtils - Running command line operation: [xcrun, simctl, uninstall, 866D3CE2-D726-45DF-8FD0-A9284C0A18C0, dev.mobile.maestro-driver-iosUITests.xctrunner]
[INFO ] x.installer.LocalXCTestInstaller - [Done] Uninstall XCUITest runner
[INFO ] x.installer.LocalXCTestInstaller - [Failed] Ensure XCUITest runner is running on 866D3CE2-D726-45DF-8FD0-A9284C0A18C0
[INFO ] x.installer.LocalXCTestInstaller - [Retry] Retrying setup() 2th time
bartekpacia commented 3 weeks ago

Hey, I tried to reproduce this on Xcode 16 Beta 6 and iOS simulator with iOS 18, and didn't manage to.

I ran: maestro test e2e/workspaces/demo_app/fill_form.yaml.

Please share more information so we can reproduce the issue.

freak4pc commented 3 weeks ago

This seems solved for us in beta 6. Thanks !

bartekpacia commented 3 weeks ago

That's great to hear, thanks!

github-actions[bot] commented 2 weeks ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!