Practice shop

An end-to-end flow: search, add to cart, update quantities, apply promo code SAVE10, check out. The cart survives page reloads.

Exercises

Product cards carry data-product-id, which is handy for counting results without matching the testids inside each card.

1. Search, filter and sort

Beginner

Use the search box, the category filter and the sort order together.

Expected: searching keyboard leaves 1 product; the Books category has 2; sorting all products by price (low to high) puts the €19.99 T-shirt first; a search with no matches shows No products match your search.

Show me how

2. Cart totals and promo codes

Intermediate

Add one Mechanical Keyboard (€89.90) and two copies of Clean Code (€34.95), then apply SAVE10.

Expected: the cart count is 3, subtotal €159.80, discount -€15.98, total €143.82. The sold-out USB-C Hub can't be added, and an unknown code like FREEBIE is rejected with a message.

Show me how

3. Stock limits and quantities

Intermediate

Only 2 monitors are in stock. Try to buy 5, then remove them all by setting the quantity to 0.

Expected: typing 5 in the monitor's quantity box snaps back to 2 and Add to cart becomes disabled; a quantity of 0 removes the line and the cart says Your cart is empty.

Show me how

4. Complete a purchase

Intermediate

Buy a QA Hoodie with express shipping, from the catalogue all the way to the confirmation.

Expected: checkout shows €58.99 (€49.00 + €9.99 express); after placing the order you see an order number like ORD-12345678 and the same amount charged; continuing shopping shows an empty cart, even after a reload.

Show me how

5. Checkout validation

Beginner

Try to place an order with missing details, then with a badly formatted postal code.

Expected: an empty form shows Please fill in all shipping fields.; postal code 1000 shows Postal code must look like 1000-001. and that field is marked invalid. No order is placed.

Show me how