Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Fix wait in networkIdle when event already fired
Browse files Browse the repository at this point in the history
We need to register that the `networkIdle` event has fired, just as
we're doing for the `load` and `DOMContentLoaded`. We sometimes see
that the `networkIdle` event is fired before the frame has a chance
to register a listener/handler.
  • Loading branch information
ankur22 committed Oct 10, 2022
1 parent 508bcb8 commit c818b3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/frame_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,8 @@ func (fs *FrameSession) onPageLifecycle(event *cdppage.EventLifecycleEvent) {
fs.manager.frameLifecycleEvent(event.FrameID, LifecycleEventLoad)
case "DOMContentLoaded":
fs.manager.frameLifecycleEvent(event.FrameID, LifecycleEventDOMContentLoad)
case "networkIdle":
fs.manager.frameLifecycleEvent(event.FrameID, LifecycleEventNetworkIdle)
}

eventToMetric := map[string]*k6metrics.Metric{
Expand Down

0 comments on commit c818b3c

Please sign in to comment.