有可能在一段时间间隔后按一下按钮吗?
简单地说,我想对2秒后存在的按钮执行logoutButton.tap()

最佳答案

很简单。只需使用waitForExpectationsWithTimeout

let exists = NSPredicate(format: "exists == true")

expectationForPredicate(exists, evaluatedWithObject: view, handler: nil)
waitForExpectationsWithTimeout(5, handler: nil)

关于ios - 如何在XCode 7中的UITests下在持续时间之后执行.tap()?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33362636/

10-14 20:50
查看更多