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
public func waitForExpectationsWithTimeout(timeout: NSTimeInterval, handler: XCWaitCompletionHandler?)
The method to create an expectation I have been using has been
public func expectationForPredicate(predicate: NSPredicate, evaluatedWithObject object: AnyObject, handler: XCPredicateExpectationHandler?) -> XCTestExpectation
But this takes an already existing element, whereas I would like to have the test wait for an element that does not yet exist.
Does anyone know the best way to do this?