Playwright Test Automation Lab
Reliable automation is test design plus code.
The fastest way to create a brittle suite is to automate clicks without thinking about intent, observability, state and failure diagnosis. These exercises focus on the choices that make Playwright tests useful in CI.
// The goal is not this:
click → sleep → click → sleep → expect(true)
// The goal is observable, deterministic evidence of business behaviour.
Choose the most resilient locator
You need to click the Save button. The DOM contains a generated CSS class, visible text "Save", and an accessible role/name.
Wait for behaviour, not time
After Submit, an API call completes and a success banner appears. The test is flaky in CI.
What should an assertion prove?
A checkout test clicks Pay and only checks that the button disappears.
When should you use API setup?
Every UI test spends 40 seconds navigating screens just to create prerequisite data before testing a small account setting.
Current score
0 / 4