Closed ppamorim closed 4 years ago
@ppamorim I guess you need to simulate pressing buttons on the virtual keyboard.
@Sunspension What I did was to use this function to type the desired password:
private func typeKey(_ keyString: String) {
let appKeys = app.keys
let keysMapped = keyString.map { key in appKeys[String(key)] }
for index in 0..<keysMapped.count {
keysMapped[index].tap()
if index == keysMapped.count - 1 {
Thread.sleep(forTimeInterval: 0.5)
}
}
}
To use it just call like this:
typeKey("5555")
Hi, I am trying to type a security PIN in an
XCTestCase
but I could not do it so far.Tried these both below, no success:
Being
securityPinView
theaccessibilityIdentifier
value.