I have a webapp with a list of images and their titles below each image. On this page other users are uploading images as well and I am running my cypress tests once per a day.
I want to find via cypress my test image, created by my cypress test – e.g. cypress-img.
Normally it is not a problem to find it via cy.get
or .find
the id, class or image title of my image.
But the page loads the items as the user scrolls down, so there is no pagination. First it shows e.g. 20 images, and as you scroll down, it dynamically loads another 20 images etc.
My test image could be somewhere on the bottom as other users are also uploading images .
So my cypress tests are failing, not finding my image, because they only loads when I scroll down.
Even when I try with cy.get('.container').scrollTo('bottom')
doesn’t help.