BrauzerLab
← Back to missions 28 / 50

`waitForLoadState(networkidle)`

Hard ~240 sec

Sometimes after a page navigates, several API requests run in parallel — the navigation may be complete but the network is still active. In this case use page.waitForLoadState('networkidle'): it waits until all active network requests have finished.

The networkidle state means: no new network connections have been opened in the last 500 ms.

page is available. Call waitForLoadState('networkidle'), then assert the #dashboard element.

TASK

Wait until the page has fully loaded.

Provided for you
import { test, expect } from '@playwright/test';

test('`waitForLoadState(networkidle)`', async ({ page }) => {
  await page.goto('https://lab.local/mission/wait-for-load-state');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/wait-for-load-state
Loading...
Results will appear here — press Run or Check.