Device can be rotate by changing orientation in XCUIDevice.shared().orientation:
orientation
XCUIDevice.shared().orientation
XCUIDevice.shared().orientation = .landscapeLeft XCUIDevice.shared().orientation = .portrait