Playwright

Snapshot a single component

Hard120 pts
  • Component Snapshot
  • toHaveScreenshot
  • Pixel Match
Practice app · Practice Catalog

A product catalog with ids, names, classes, links, data-testids and duplicate buttons for locator practice.

Test URL
/lab/playwright-snapshot-a-single-component

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Compare visual pixel diffs of an isolated UI component.

Your Task

  1. 1Navigate to the locators scenario page.
  2. 2Locate the first product card .product-card.
  3. 3Perform a visual screenshot assertion on the product card element.

Validation Checks

  • Performs toHaveScreenshot assertion on a component locator
  • At least 1 assertion passes

Playwright · Playwright Practice Track · Visual & accessibility