【发布时间】:2018-09-20 13:30:08
【问题描述】:
我们最近从 Xcode 8 升级到了 10。在终于重新编译所有内容后,我在单元测试中遇到了涉及方向更改的问题。 我一直在做的模拟设备方向变化是
XCUIDevice.shared().orientation = .landscapeLeft
...
XCUIDevice.shared().orientation = .faceUp
...
etc.
现在执行此行时,“设备”(iPhone 8+ 的模拟器)正在进行适当的方向更改,但由于确认超时,调用最终失败:
[iMomTests.DataScreenTests testLandscape] : Failed to set orientation: Error Domain=XCTDaemonErrorDomain Code=15 "Timed out waiting for confirmation of orientation change." UserInfo={NSLocalizedDescription=Timed out waiting for confirmation of orientation change.}
【问题讨论】:
-
我也看到了这一点,它使我们无法迁移到 Xcode 10,因为它破坏了我们的单元测试。这能被抓住和处理吗?看起来不像。
-
另外,在第一次失败后,对景观的后续更改会成功且不会出现错误。
标签: swift unit-testing timeout orientation xcode10