Playwright practice project

Write tests for an online shop

A shopper changes a quantity, exceeds the stock limit, then places an order. Write tests that follow the quantity from the cart to the saved order.

Project tasks

Cart changes

Free task · No account needed

Check what the cart keeps after an update.

  • The first quantity enters the cart.
  • A later quantity replaces the earlier quantity.
  • The cart shows the requested total, without adding the quantities together.
Open cart changes →

Stock limits

Pro task

Check the cart after a request is rejected.

  • An available quantity enters the cart.
  • A quantity above the stock limit shows an error.
  • A rejected quantity does not change the cart.
Open stock limits →

Checkout

Pro task

Check the order behind the confirmation message.

  • An empty name cannot place an order.
  • The saved order keeps the accepted cart quantity.
  • The cart is empty after the order is placed.
Open checkout →

Your test suite

Pro task

Bring the checks together with separate setup for each test.

  • A changed cart quantity replaces the earlier quantity.
  • A rejected stock request leaves the cart unchanged.
  • A placed order keeps the cart quantity.
Open your test suite →

What is included

Each task has a short lesson, a starter test and a checklist. Write the missing checks yourself. Use a hint when you need help. Open a worked solution with an explanation when ready.

Run tests checks the working shop. Verify runs your test against the working shop, then checks each planted break separately. It reports whether your test noticed the changed behaviour.

The editor runs supported Playwright commands in your browser. It is not a full local Playwright installation. Use a wide screen for the editor. Your code and verified runs stay in this browser. They do not sync between devices. If storage is blocked, they last until you leave.

Recorded starter test

Stock-limit teaching task · 2026-12-01

Run tests
Your test passed on the working app. A test can pass and still miss a bug.
Verify
0 of 1 planted bug caught.
Missed: The cart accepts more items than the available stock.
Try Cart changes free. No account is needed. A course plan opens the remaining tasks. These tasks are for learning. They are never used in an assessment. Teaching help is unavailable during an active interview or assessment.

Existing practice problems and Verify stay free. Browse free problems.