Web Application Testing with Playwright
This skill helps you create and run browser-based tests for web applications using Playwright.
When to use this skill
Use this skill when you need to:
- •Create new Playwright tests for web applications
- •Debug failing browser tests
- •Set up test infrastructure for a new project
Creating tests
- •Review the test template for the standard test structure
- •Identify the user flow to test
- •Create a new test file in the
tests/directory - •Use Playwright's locators to find elements (prefer role-based selectors)
- •Add assertions to verify expected behavior
Running tests
To run tests locally:
bash
npx playwright test
To debug tests:
bash
npx playwright test --debug
Best practices
- •Use data-testid attributes for dynamic content
- •Keep tests independent and atomic
- •Use Page Object Model for complex pages
- •Take screenshots on failure