正如标题所示,我使用UI测试创建了一个新项目,但它失败了.
/.../Test2/Test2UITests/Test2UITests.swift:37: error: -[Test2UITests.Test2UITests testLaunchPerformance] : Failed to terminate com.darylteo.Test2.Test2:27031: Failed to terminate com.darylteo.Test2.Test2:0
t = 60.29s Tear Down
Test Case '-[Test2UITests.Test2UITests testLaunchPerformance]' failed (60.288 seconds).
Test Suite 'Test2UITests' failed at 2022-09-18 13:34:26.714.
Executed 2 tests, with 1 failure (0 unexpected) in 65.396 (65.400) seconds
该应用程序只是在模拟器中变黑,但模拟器仍然是交互式的,应用程序可能会被硬停止.我无法运行一个测试套件而它不会以这种方式失败,并且重复运行一个测试也会遇到相同的问题(成功一次,失败一次)
我猜这可能是模拟器的调试连接出现了某种问题,但这种不可靠的情况完全让XCUITest毫无用处.
-
配备Pro Max的M1 MacBook Pro 16英寸
-
蒙特利12.5.1(21GB3)
-
Xcode版本14.0(14A309)
-
模拟器:
- Version 14.0 (986.3)
- 模拟器套件624
- 核心模拟器857.7
感谢????提供的帮助
其他尽职调查:
- 类似的问题,但它已经4年了,错误信息略有不同,指的是旧的Xcode错误.UITest Failed to terminate com.test.abc:3708 after 60.0s; state is still `Running Foreground个
- 类似问题,但仅限于快速通道CI,而不是模拟器How to fix "Failed to terminate app" error in XCUItests?
- 另一个非常古老的帖子,只是 brute 地强迫测试.可能会try 将此作为解决办法.XCTests failing to launch app in simulator intermittently个
- 开放雷达,6岁了.没有决议http://www.openradar.appspot.com/25548393