Please note, this blog entry is from a previous course. You might want to check out the current one.
Lecture nineteen is named “19. Automated Testing (December 6, 2011) – HD” and can be found at iTunes.
The lecturer Andy Matuschak from the UIKit team at Apple uses a short demo to introduce unit tests and automation.
Unit tests are defined by creating subclasses of SenTestCase. The actual unit tests are methods starting with the prefix test, testing expectations using STAssert* and use the methods setUP and tearDown for shared initialization and clean up.
iOS UI Automation allows to run top down tests on the user interface using the automation tool of Instruments. Actions can be recorded and the app be manipulated via UIAElements in JavaScript, which can also be used to inspect states calling UIALogger logFail/Pass methods. Within a script accessibilityLabels can be used for easy access to interface elements.