getByTestId / getByRole locatorsAuto-wait & web-first assertionsMulti-tab, frames & dialogsTrace viewer & codegen
Two complete apps to automate end to end, plus focused element-handling recipes โ all in Playwright.
๐๏ธNova Shop
Login with test users, search/filter/sort products, cart & coupons, a validated checkout, a declined card and order history.
- โ3 test accounts incl. locked & slow
- โCart maths, coupons, tax & shipping
- โForm validation + payment failure
๐ฌShowTime
Pick city, date and showtime, select seats on a live seat map, add snacks, apply promos and pay with an OTP step under a hold timer.
- โSeat map with tiers & limits
- โCountdown timer & clock mocking
- โOTP modal, async UPI, cancellations
๐งฉ50+ challenges
Focused recipes for inputs, dropdowns, tables, alerts, frames, windows, drag & drop, uploads, hover, waits, shadow DOM and keys.
- โ15 copy-ready recipes
- โEach linked to a live challenge
- โTool-specific gotchas called out
Run this site locally with npm run dev โ examples target http://localhost:3000.
npm init playwright@latest
# playwright.config.ts
# use: { baseURL: 'http://localhost:3000' }
Sign in to Nova Shop and assert the product grid loaded.
import { test, expect } from '@playwright/test';
test('demo_user can sign in', async ({ page }) => {
await page.goto('/shop');
await page.getByTestId('username').fill('demo_user');
await page.getByTestId('password').fill('Demo@123');
await page.getByTestId('login-button').click();
await expect(page).toHaveURL(/\/shop\/products/);
await expect(page.getByTestId('product-card')).toHaveCount(12);
});
Official docs: https://playwright.dev/docs/intro