we set-up visual regression testing for our website (with BBC Wraith). Everything works well if the page has no youtube video embedded. If a page has one embedded it sometimes occurs that WRAITH takes a screenshot of the page before the YouTube Thumbnails was loaded. Of course, we could just extend the timeout for Wraith to wait a little longer for those pages in order to increase the chances the thumbnail is there already - but there might be a better solution.
Therefore we would like to understand if there is a way to find out, if the YouTube thumbnail was loaded.
Due to Same-origin policy we can't access the YouTube iframe with JS.
Update: I tried to use the YouTube iFrame API (https://developers.google.com/youtube/iframe_api_reference?hl=en#Events) and worked with onReady-Event. It is triggered when the player is ready to receive API-calls but this does not seem to require the thumbnail to be loaded.
Are there any other ideas? (e.g. check if the browser loaded a specific ressource from youtube etc.)
Thanks.