Xcode UI testing

:  ~ 45 sec read

This is really, really awesome. Run your app and press the record button (next to the enable/disable breakpoints): as you navigate your app, code will be automatically generated. A quick test for LTHMonthYearPickerView:

let app = XCUIApplication()
let toolbar = app.toolbars

app.pickerWheels["2015, 46 of 91"].swipeUp()
toolbar.buttons["Done"].tap()

let textField = app.childrenMatchingType(.Window)
	.elementAtIndex(0)
	.descendantsMatchingType(.Unknown)
	.childrenMatchingType(.TextField)
	.elementAtIndex(0)

XCTAssertTrue(textField.value as! String == "June / 2034")
XCTAssertFalse(textField.value as! String == "June / 2033")

The value property is, as described in the documentation:

The raw value attribute of the element. Depending on the element, the actual type can vary.