Running UI Tests on iOS With Ludicrous Speed
We rely on busy waiting via creating a custom runloop - the condition is checked every x milliseconds and only once it returns
true
, the control flow continues. This might seem crude, but it’s a much, much better solution than adding random timeouts and allows us to run tests at an insane speed while also getting reliable results, even under heavy load. It’s somewhat similar toXCTestCase
’s asynchronous testing extensionwaitForExpectationsWithTimeout:handler:
, just faster and more flexible.Now, the final puzzle is to simply increase the speed of Core Animation itself. And the best part: This is not even private API!