Tách Page Object Models (POM) đơn giản để test không bị lặp code
Automation
Authentication shortcut: Đăng nhập → Lưu State vào localstorage
Debug
npx playwright test —debug
page.pause()
Trace viewer (npx playwright show-trace)
Parallel & retries
retries, workers, projects (multi-browser)
Filter test bằng tags
Run command
# Run all tests
npx playwright test
# Run tests in a specific file
npx playwright test tests/example.spec.ts
# Run a specific test by name
npx playwright test --grep "has title"
# Run tests in headed mode (see the browser)
npx playwright test --headed
# Run tests in debug mode
npx playwright test --debug
# Run tests on a specific browser
npx playwright test --project chromium
# Run tests with UI mode
npx playwright test --ui
# Show the HTML report after tests run
npx playwright show-report