0

If one has an Google Maps iFrame like https://www.google.com/maps/embed?... on a page a simple document.ready won't work as the iframe will only load its content if it is in the visible window portion. Thus scrolling the page to the bottom will init the loading asynchronously.

However how can one test if a Google Maps iFrame has finished all its loading and loading animation (jQuery or plain JavaScript)?

Background:

Using CodeceptJS we do visual regression testing doing full page screenshots. However the screenshots differ as the iframe is not fully loaded (thus would be loaded differently fast for the two screenshots by random).

A simple scrollToPageBottom inits it and a wait(10) will work. However it should just wait as long as necessary to reduce CI pipeline duration with hundreds of tests. As the Playwright helper doesn't offer this natively it seems running a JavaScript command seems more suitable. As all underlying sites use jQuery this can be used to ease complexity.

NextThursday
  • 2,352
  • 3
  • 15
  • 18

0 Answers0