Assert a locator count
Medium70 pts
- toHaveCount
- List assertions
- Auto-waiting
Practice app · Practice Catalog
A product catalog with ids, names, classes, links, data-testids and duplicate buttons for locator practice.
Your starter code already declares TEST_URL — never hardcode a host.
Objective
Verify the total count of product cards displayed in the catalog using an auto-waiting count assertion.
Your Task
- 1Navigate to the practice catalog page at TEST_URL.
- 2Locate all product cards (.product-card) rendered in the catalog grid.
- 3Assert that exactly 3 product cards exist on the page.
Validation Checks
- Practice catalog application is loaded at TEST_URL
- Product cards (.product-card) are targeted
- Exactly 3 product cards are verified using
toHaveCount - At least 1 assertion passes
Playwright · Playwright Practice Track · Locators & auto-waiting