AGENT SKILL

playwright

End-to-end testing with Playwright for user journeys and accessibility

使用场景测试与质量
License 许可
MIT
最近更新
2026-07-20
Stars
★ 0
Forks
0

01 前言 Front Matter

name
playwright
applyTo
tests/e2e/**/*.{ts,tsx}
description
End-to-end testing with Playwright for user journeys and accessibility

03 SKILL.md 正文

Playwright E2E Testing Skill

Purpose

Write and maintain end-to-end tests that verify critical user journeys, accessibility compliance, and cross-browser behavior using Playwright.

Locator Priority

Use accessible locators in this order:

  1. page.getByRole() — semantic role + accessible name
  2. page.getByLabel() — form controls by label
  3. page.getByText() — visible text content
  4. page.getByPlaceholder() — input placeholders
  5. page.getByTestId() — last resort for complex selectors

Best Practices

  • Test critical user journeys, not individual components.
  • Configure retries for CI (retries: 2).
  • Capture screenshots on failure.
  • Never hard-code sleeps/timeouts; rely on Playwright auto-waiting.
  • Run against production build when possible.

Running Tests

task test:e2e
task test:e2e:headed
task test:e2e:install

04 同仓库更多 Skills