Testing UIKit

It is possible to unit test UIKit components. It’s annoying and in a lot of places undocumented. However, in my experience, it is significantly faster and more reliable to test UI from what xcode describes as a unit test perspective vs. using XCUITest.

As far as this document is concerned, a unit-testing perspective means that the tests run in the same process the code being tested runs in. For example, in a UI Testing Bundle, there are 2 separate processes running: The app itself is running in one process, and the tests are running in a second process. They communicate via IPC.


Last updated: 2021-11-14 22:08:54 -0800