You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We added a .page-loaded class when all of the page assets have loaded as part of #3789
Looks like the class isn't always being added to the page. According to @evwilkin
well i can’t exactly say why it happens in incognito and not elsewhere, but i believe the TLDR is the window.load event listening is being added to the page after it’s already loaded. The listener is always there, but only triggers a “load” outside of Chrome incognito
hard to google what causes that and why it’s working in Chromium but not Chrome for me, but luckily I think there’s an easy fix - before we add the event listener we check document.readyState - if it’s “complete” we go ahead and add the class, if not we add the listener as we do now
And Evan said this was working for him
if (isFullscreenPreview) {
isFullscreen = false;
if (document?.readyState === 'complete') {
document.body.classList.add('page-loaded');
} else {
window.addEventListener('load', () => {
//append a class to the document body to indicate to screenshot/automated visual regression tools that the page has loaded
document.body.classList.add('page-loaded');
});
}
}
Once that is working, we'll want to add that to the core repo's backstop config as the readySelector, outlined in patternfly/patternfly#6602
The text was updated successfully, but these errors were encountered:
We added a
.page-loaded
class when all of the page assets have loaded as part of #3789Looks like the class isn't always being added to the page. According to @evwilkin
And Evan said this was working for him
Once that is working, we'll want to add that to the core repo's backstop config as the
readySelector
, outlined in patternfly/patternfly#6602The text was updated successfully, but these errors were encountered: