Skip to main content
Executes a callback function and waits for network activity to settle before returning.

withNetworkSettledWait vs waitForDomSettled

  • Use withNetworkSettledWait when watching network requests (API calls, form submissions, resource loading)
  • Use waitForDomSettled when watching DOM mutations (elements added/removed/modified, loading spinners, dynamic content injection)

Examples

Arguments

callback
Function
required
The callback function to execute. Receives the page object as parameter
options
Object
Configuration options for network monitoring

Returns: Promise<T>

Promise that resolves to the callback’s return value after network settles