Currently I access photo gallery and pick up a photo the following way:
extension XCUIApplication {
func pickPhotoFromImagePickerAtIndex(index: UInt) {
tables.buttons["Moments"].tap()
collectionViews["PhotosGridView"].tapCellAtIndex(index)
}
}
Example of use:
photosCollectionView.tapCellAtIndex(0)
app.pickPhotoFromImagePickerAtIndex(5)
This method crashes sometimes. It depends on photos in gallery.
Is there any way to do this in more elegant and effective way?