BrauzerLab
← Back to missions 5 / 50

data-testid — The Gold Standard

Easy ~90 sec

The product list has two identical «Add to Cart» buttons — one for the camera, one for the phone. Finding by text won’t work here: both buttons carry the same label.

The data-testid attribute solves this problem. The front-end team has given each button a unique test identifier.

Your job: find only the camera button and click it. page is already available.

TASK

Click the «Add to Cart» button for the camera.

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

test('data-testid — The Gold Standard', async ({ page }) => {
  await page.goto('https://lab.local/mission/test-id');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/test-id
Loading...
Results will appear here — press Run or Check.