2016-05-25 28 views

回答

2

你將不得不設置斷言爲條件要測試:

let doesNotExistPredicate = NSPredicate(format: "exists == FALSE") 

然後在您的測試案例爲您的斷言和UI元素的期望:

self.expectationForPredicate(doesNotExistPredicate, evaluatedWithObject: element, handler: nil) 

然後等待您的期望(指定超時後,如果未達到預期,測試將失敗,此處使用5秒):

self.waitForExpectationsWithTimeout(5.0, handler: nil)