Loading...
Loading...
Playwright browser automation API, web scraping, and tooling. Covers locator strategies, assertions, API testing, stealth mode, anti-bot bypass, authenticated sessions, screenshots/PDFs, Docker deployment, configuration, debugging, and MCP integration with AI agents. Prevents documented errors including CI timeout hangs, extension testing failures, and navigation issues. Use when automating browsers, scraping protected sites, bypassing bot detection, generating screenshots/PDFs, configuring Playwright Test, troubleshooting Playwright errors, or learning Playwright API patterns. For E2E test architecture, Page Object Models, CI sharding strategies, or test organization patterns, use the e2e-testing skill instead.
npx skill4agent add oakoss/agent-skills playwrightfetche2e-testing| Pattern | API / Config | Key Points |
|---|---|---|
| Basic test | | Auto-wait, web-first assertions, test isolation |
| Locator | | Prefer role/label/text selectors over CSS |
| Assertion | | Auto-retrying, configurable timeout |
| API testing | | Send HTTP requests, validate responses |
| Aria snapshot | | Validate accessibility tree structure via YAML |
| Class assertion | | Match individual CSS class names (v1.52+) |
| Visible filter | | Match only visible elements (v1.51+) |
| Test step | | Timeout, skip, and attachments (v1.50+) |
| Stealth mode | | Patches 20+ detection vectors |
| Authenticated session | | Save/restore cookies and IndexedDB for persistence |
| Screenshot | | Use |
| PDF generation | | Chromium only, set |
| Docker | | Use |
| Debug methods | | No event listeners needed |
| Speedboard | HTML reporter (v1.57+) | Identifies slow tests and bottlenecks |
| Playwright Agents | | Planner, generator, healer for LLM-driven testing |
| Flaky test detection | | Exit code 1 on flaky tests in CI |
| Mistake | Correct Pattern |
|---|---|
| Using CSS selectors over role selectors | Prefer |
| Not closing browser | Always |
Using | Use |
| Guard with |
| Clicking without waiting | Use |
| Shared state between tests | Each test gets fresh context via fixtures |
| Testing implementation details | Assert user-visible behavior, not DOM structure |
| Hardcoded waits for dynamic content | Wait for selector appearance or content stabilization |
Missing | All |
| Same user agent for all scraping | Rotate user agents for high-volume scraping |
ExploreTaskcode-reviewerFor E2E test architecture, Page Object Model patterns, CI sharding strategies, authentication flows, visual regression workflows, or test organization, use theskill.e2e-testing