BeginnerPW-ECOM-00115 minutesPlaywright

Verify product stock

A shopper opens one deterministic product and wants a basic stock assertion.

  • ecommerce
  • assertions

Objective

What to automate

Open product prd-001 and verify its stock status is visible.

Preconditions and test data

Preconditions

  • Use a fresh isolated Practice Lab browser context.
  • Open the fixture identified by FX-STORE-001.

Test data

  • productId: prd-001

Expected result

The product detail displays a positive stock count matching the store API.

Progressive hints

Hint 1

Open the product URL with its id query.

Hint 2

Wait for the product heading.

Hint 3

Compare the visible stock with GET store/products/prd-001.

I’ve tried it — show solution
  1. Open the product URL with its id query.
  2. Wait for the product heading.
  3. Compare the visible stock with GET store/products/prd-001.