let webViewsQuery = app.webViews
let emailOrPhoneTextField = webViewsQuery/*@START_MENU_TOKEN@*/.textFields["Email or phone"]/*[[".otherElements[\"Sign in – Google accounts\"].textFields[\"Email or phone\"]",".textFields[\"Email or phone\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/
let exists = NSPredicate(format: "exists == TextField")
expectation(for: exists, evaluatedWith: emailOrPhoneTextField, handler: nil)
waitForExpectations(timeout: 30, handler: nil)
emailOrPhoneTextField.tap()
异步等待失败:超过超时30秒,无法实现的期望:“期待的对象谓词
exists == 1
‘电子邮件或电话’文本字段”通过FASTLANE扫描运行时,
那是因为你从来没有满足您的期望(与expectation.fulfill()
法)。使用XCTWaiter
如果你不关心期待实现。
这难道不是只是你需要让你的期望评价为真?
let exists = NSPredicate(format: "exists == true")
要么
let exists = NSPredicate(format: "exists == 1")