BrauzerLab
← Back to missions 46 / 50

Slow Network

Hard ~300 sec

Testing a loading animation requires network delay simulation. When the page.route handler is an async function, you can add an artificial delay with await new Promise(r => setTimeout(r, ms)).

The handler calls route.fulfill(...) after the delay — at that point the UI is still in the «Loading…» state. Complete the response after the delay.

page is already available. Intercept the /api/report request, add a delay of at least 1000 ms, then respond with fulfill. Finally click the «Load report» button.

The delay duration and JSON content are flexible — as long as setTimeout + fulfill are both used.

TASK

Simulate a slow network.

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

test('Slow Network', async ({ page }) => {
  await page.goto('https://lab.local/mission/slow-network');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/slow-network
Loading...
Results will appear here — press Run or Check.