xcode-ui-testing
Xcode UI Testing – Timestamped Event Matching Error
What this means is that when you click on an item, Xcode can’t figure what element it was. Not sure if it’s a bug or not. In my case I was clicking on a table view cell, and was getting this. The way I got around it was adding these lines: let cells = app.tables.cells … Read more
Xcode7 | Xcode UI Tests | How to handle location service alert?
Xcode 9 let springboard = XCUIApplication(bundleIdentifier: “com.apple.springboard”) let allowBtn = springboard.buttons[“Allow”] if allowBtn.exists { allowBtn.tap() } Xcode 8.3.3 _ = addUIInterruptionMonitor(withDescription: “Location Dialog”) { (alert) -> Bool in alert.buttons[“Allow”].tap() return true } app.buttons[“Request Location”].tap() app.tap() // need to interact with the app for the handler to fire Note that it is a bit different as … Read more
Testing if an element is visible with Xcode 7 UITest
As of Xcode 7.1 Beta 3, UI Testing does not currently support validating the visibility of an element. I suggest filing a radar to bring the necessary attention to Apple. Xcode 7.1 has fixed this issue. hittable now checks to see if the element is correct.
Is it possible to “toggle software keyboard” via the code in UI test?
Tested in Xcode 10.3 & Xcode 11. The snippet below needs to be located in the app target (not the test bundle) — for instance, in AppDelegate.swift. It will disable any hardware keyboards from automatically connecting by setting any UIKeyboardInputMode‘s automaticHardwareLayout properties to nil. 🔥 Does not depend on the settings of the Simulator. #if … Read more