Use the adding-e2e-tests skill to set up a minimal local Playwright test for this project. Configure the actual development-server URL and start command, use Chromium locally, and add one homepage smoke test that checks the page has a nonempty title. Add test:e2e and test:e2e:ui scripts to package.json. Add the generated test-results/, playwright-report/, and blob-report/ directories to .gitignore.
Required inputs
The target web project with npm available.
Its development-server start command and local URL; http://localhost:3000 is only the author's example.
Details of any existing test runner.
Previously published starter task based on a pinned source version; check the source and required inputs before running. Task evidence ↗
SKILL.md
name: adding-e2e-testsdescription: Set up Playwright end-to-end testing in a project, including test configuration, example tests, and CI integration.
Add E2E Tests (Playwright)
Use this skill when the user asks to add end-to-end tests, browser tests, integration tests, or set up Playwright.
Steps
Install Playwright
npm init playwright@latest
This creates playwright.config.ts, a tests/ directory, and installs browsers. If the project already has a test runner, install manually:
Add page object pattern (optional) — for larger apps, create a tests/pages/ directory with page objects that encapsulate selectors and actions.
Add npm scripts
{
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui"
}
Add to .gitignore
test-results/
playwright-report/
blob-report/
CI integration — add a GitHub Actions step that runs npx playwright install --with-deps then npm run test:e2e. Use the official actions/upload-artifact to save the HTML report on failure.
Notes
Use data-testid attributes for selectors instead of CSS classes.
Use test.describe to group related tests.
Run npx playwright codegen to record tests interactively.