BrauzerLab
← Back to missions 38 / 50

Assert Count

Medium ~180 sec

The page on the right shows a list with 4 products. Your job: use expect to assert that the number of elements in the list is exactly 4.

Playwright provides a dedicated assertion method for checking how many elements match a locator. This method is widely used in tests — for example, to verify how many items remain after filtering.

The page object is already available. Find the product elements and assert their count.

You can locate the elements using different locator strategies — any correct approach is accepted.

TASK

Assert the number of product cards on the page.

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

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