BrauzerLab
← Back to missions 42 / 50

Empty Response: Edge Case

Medium ~240 sec

Testing the correct UI behaviour when an API returns an empty array is an important edge case. You can simulate the network without a real backend using network simulation (page.route).

route.fulfill({ status, contentType, body }) returns a fake response to the request. Passing '[]' as body makes the API behave as if it returned zero results — it is then your job to verify whether the UI shows the empty state.

page is already available. Intercept the request to /api/products and respond with an empty array.

Either a glob pattern (**/products) or an exact path is accepted.

TASK

Handle the empty data state.

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

test('Empty Response: Edge Case', async ({ page }) => {
  await page.goto('https://lab.local/mission/empty-data-edge-case');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/empty-data-edge-case
Loading...
Results will appear here — press Run or Check.