openverse-frontend
openverse-frontend copied to clipboard
Make Playwright scroll wait times more reliable
Problem
Playwright utilities being added in #1530 at the time of opening of this issue have arbitrary sleep durations to make sure that the images are loaded when the page get scrolled. We need to make them less flaky.
Description
@sarayourfriend's comment has the code suggestion to implement an approach that waits for visibility/load state before continuing. I did not add the code in #1530 because it's not possible to test how well it works without the actual tests to run it. And adding more tests would bloat that PR. Once we have the sample Playwright tests that use scrolling to load all of the page images (such as #1542), we should add the code suggestions to make scroll waits more reliable.
Implementation
- [ ] 🙋 I would be interested in implementing this feature.