Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI Testing Failure: Failed to update to requested orientation

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.

enter image description here

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.

enter image description here

like image 360
Bartłomiej Semańczyk Avatar asked Oct 07 '16 12:10

Bartłomiej Semańczyk


1 Answers

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.

like image 114
Rashwan L Avatar answered Oct 14 '22 13:10

Rashwan L