2
버튼이 활성화되어 있는지 확인한 후 버튼을 탭하려면 어떻게해야합니까?expectationForPredicate를 사용하고 버튼을 누르는 방법
여기에서이 샘플을 찾았지만 내 경우에는 작동하지 않았습니다. 여기
Delay/Wait in a test case of Xcode UI testing
코드의 일부 :
let app = XCUIApplication()
let button = app.buttons["Tap me"]
let exists = NSPredicate(format: "exists == 1")
expectationForPredicate(exists, evaluatedWithObject: button){
button.tap()
return true
}
waitForExpectationsWithTimeout(5, handler: nil)
하지만 내 테스트 버튼으로 눌러 실패합니다. 감사합니다.
코드는 올바른 보이는, 내가/존재하지 않는 버튼을 추측하고하는 버튼이 전무 경우 – Daniel
당신은 확인 했나 찾을 수 없습니다? – LoVo
콘솔 중 : po button.enabled true를 반환합니다. – emoleumassi