We are trying to get a UIAutomation test around a flow in our app where a user selects an image from a UIImagePickerController. All the automation works great, until we try
First I pick the moments row, and then I select the photo. Later I click the button choose that confirms the picked image.
let moments = app.tables.cells.element(boundBy: 0)
moments.tap()
sleep(3)
let selectedPhoto = app.collectionViews.element(boundBy: 0).cells.element(boundBy: 0)
sleep(3)
selectedPhoto.tap()
sleep(3)
//Choose Button
let chooseButton = app.buttons.element(boundBy: 1)
chooseButton.tap()
Hope it helps