Sometimes under continuous integration there is an error (seem to be random error) like this:
Test Assertion UI Testing Failure - failed: Failed to update to requested orientation.
While testing, device is rotated to the landscape mode and... it does not return back to the portrait mode. Why?
Do you know what may cause such Issue?
In code I have a lines:
XCUIDevice.shared().orientation = .landscapeLeft
XCUIDevice.shared().orientation = .portrait
It looks like related to the following part of code, but I do not know how to solve it.
Appreciate any help.
There is basically nothing to solve this is a Xcode 8 bug. When you get this error just rerun nothing else to do atm. I never had this issue on Xcode 7. What the error message is telling you is that it failed to get the requested orientation and your code lines is looking good:
XCUIDevice.shared().orientation = .landscapeLeft
XCUIDevice.shared().orientation = .portrait
Apple will hopefully solve this issue soon. You also could report a bug to Apple too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With