這就是我在代碼中設置它:UITests:如何通過具有謂詞的accessibilityIdentifier找到UIBarButtonItem?
XCUIApplication().otherElements["userBarButtonItem"] //doesnt work, and the reason is:
斷言失敗:UI測試失敗 - 未找到「匹配
let userBarButtonItem = UIBarButtonItem(image: userIcon, style: .Plain, target: self, action: Selector("userButtonTapped:")) userBarButtonItem.accessibilityIdentifier = "userBarButtonItem"
然後裏面
UITestCase
我需要這個用找userBarButtonItem「其他
有沒有辦法如何找到這個例如使用謂詞?
你得到一個答案呢? – Sandy
不幸的是,仍在尋找答案... –