Locate the checkout action
Easy35 pts~12 min
- Locators
- Accessibility
- Resilience
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
Choose a resilient, user-facing locator for the checkout action and use it to start checkout.
Your task
- 1Open TEST_URL (the practice catalog).
- 2Add the “Playwright Tee” to the cart by scoping the duplicated “Add to cart” button to its product card.
- 3Click checkout with getByRole("button", { name: "Proceed to checkout" }) or getByTestId("checkout").
- 4Assert #cart-count is "1" and #checkout-status reads "Checkout started with 1 item".
Acceptance criteria
- Checkout starts with 1 item
- A role or test-id locator is used
- No positional CSS or XPath
- At least 2 assertions pass
Playwright · Playwright · Featured challenges