I want to have a test pause and wait for an element to appear on screen before proceeding.
I don\'t see a good way to create an expectation for this and wait using
In expectationForPredicate(predicate: evaluatedWithObject: handler:)
you don't give an actual object, but a query to find it in the view hierarchy. So, for example, this is a valid test:
let predicate = NSPredicate(format: "exists == 1")
let query = XCUIApplication().buttons["Button"]
expectationForPredicate(predicate, evaluatedWithObject: query, handler: nil)
waitForExpectationsWithTimeout(3, handler: nil)
Check out UI Testing Cheat Sheet and documentation generated from the headers (there is no official documentation at the moment), all by Joe Masilotti.