Skip to content

Commit

Permalink
fix(e2e): readiness flag on slow or overloaded computers (#2525)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcylabs committed Jul 4, 2020
1 parent 915bfce commit a19ac90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/testing/puppeteer/puppeteer-events.ts
Expand Up @@ -222,6 +222,10 @@ function browserContextEvents() {
if (window.document.readyState === 'complete') {
stencilReady();
} else {
window.addEventListener('load', stencilReady);
document.addEventListener('readystatechange', function (e) {
if ((e.target as Document).readyState == "complete") {
stencilReady();
}
});
}
}

0 comments on commit a19ac90

Please sign in to comment.