The root cause of the issue is that Xcode / the iOS Simulator has issues in performance limited environments. This included Virtual Machines (which is how your builds are running on bitrise.io), MacBook Airs, Mac Minis with HDD storage, …
It can happen even if you use Apple’s Xcode Bots CI server on non SSD Mac Mini.
Examples:
-
UI Tests fail to start
-
One or more UI Test case hangs
-
As reported in this StackOverflow answer & in this Apple dev forum discussion a possible workaround can be to not to store
**XCUIApplication()**
in a variable, instead reference / use it directly. E.g. instead of:let app = XCUIApplication() ; ... ; app.launch()
do:XCUIApplication().launch()
-
Others reported that if you add a delay (
sleep(10)
) after everyapp.launch()
related to your tests, it can leave enough time for Xcode / the iOS Simulator to initialize the Accessibility labels, so that UI Tests can properly find the elements by the Accessibility labels. (Related Apple developer forum discussion)-
Related: remove every explicit
app.terminate()
in yourtearDown()
method(s)
-
-
Try another Simulator device
-
Some users had success with splitting the tests into multiple Schemes, and running those separately, with separate Test Steps.
-
A great article about splitting tests into multiple Schemes: http://artsy.github.io/blog/2016/04/06/Testing-Schemes
-
-
Sometimes it’s related to a code which makes Xcode to misbehave
-
Try another Xcode version.
-
XCode bot error: Early unexpected exit, operation never finished bootstrapping
-
UI Testing Failure - Failed to launch within 2.5s, Interrupting test
-
Assertion Failure: UI Testing Failure - Failed to receive completion for …
-
UI Testing Failure - Failed to perform AX action for monitoring the event loop