swiftcoded-ui-testsxcuitest

Xcuitest - How can I wait until image finished to load


I'm running my UiTests on app that uses images/videos from the camera roll/Google photos/Etc..

All the images/videos are in CollectionView and each asset is in a specific cell.

When the app opens the "footage screen" it contains 15 assets at the same time and I'm trying to create a function that waits until all of the images finish to load.

Why do I need it: I have tests that select images/videos and sometimes the Xctest could select the first one because not all of the assets finish loading.

Note: I don't have any indication that tells me "all the assets finish to load".

Any suggestions?


Solution