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
const{ chromium }=require("playwright");(async()=>{constbrowser=awaitchromium.launch();constpage=awaitbrowser.newPage();letinProgress=0;page.on('request',request=>{console.log(Date.now(),'>>',request.method(),request.url());inProgress++;});page.on('response',response=>{console.log(Date.now(),'<<',response.status(),response.url());inProgress--;});console.log(Date.now(),"waiting for page");awaitpage.goto("http://localhost:3000/",{// waitUntil: "networkidle",});console.log(Date.now(),"waiting 500");awaitpage.waitForTimeout(500);console.log(Date.now(),"waiting for networkidle");awaitpage.waitForLoadState("networkidle");console.log(Date.now(),"Requests in progress after networkidle:",inProgress);awaitbrowser.close();})();
Describe the bug
The networkidle event can fire even though requests are in progress (but are taking longer, for example). I would expect the event to fire after 500ms of no requests in progress. (The example script should always finish with inProgress === 0 but doesn't.)
I was not able to reproduce this during page load with waitUntil: "networkidle", so perhaps the logic is different there?
The text was updated successfully, but these errors were encountered:
Context:
Code Snippet
Describe the bug
The
networkidle
event can fire even though requests are in progress (but are taking longer, for example). I would expect the event to fire after 500ms of no requests in progress. (The example script should always finish withinProgress === 0
but doesn't.)I was not able to reproduce this during page load with
waitUntil: "networkidle"
, so perhaps the logic is different there?The text was updated successfully, but these errors were encountered: