I am using Xcode 11 & iOS 13 as part of a workflow for a UITest, but when I engage with the keyboard for the first time, the following appears and disrupts the test by blocking the keyboard:
Calling code in UI test:
app.textFields.element(boundBy: 0).tap()
Since this obstructs the keys, my test will then fail. However, the next time I run the test on the same simulator, it will work properly.
I was able to find a solution to this that works for both when it encounters the above, as well as on follow up runs where it is not present.
let continueButton = app.buttons["Continue"]
if continueButton.exists {
continueButton.tap()
}
The first line attempts to locate a button with the title of "Continue", and then proceeds to verify the existence of this button on the second line. If it does exist, it will then tap()
it which dismisses the prompt.