mcpField
P
playwright

playwright

github.com/pproencaTesting & quality2201.2k installsUpdated 11w ago
Repository

About playwright

A testing best-practices skill for Playwright with Next.js, aimed at developers writing, debugging, or optimizing end-to-end tests. It groups 43 rules into eight areas, spanning test structure, locators, authentication, Next.js behavior, performance, and CI.

Key features

  1. 0143 rules across eight categories
  2. 02Test architecture and locator guidance
  3. 03Waiting, assertions, and authentication practices
  4. 04Mocking and Next.js integration
  5. 05Performance, debugging, and CI guidance

Use cases

  1. 01Creating end-to-end tests for Next.js apps
  2. 02Diagnosing flaky or failing tests
  3. 03Reusing authentication state across tests
  4. 04Optimizing test suites for CI

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill playwright

After installing, type/playwrightin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
arch-cleanup-state.md
arch-fixtures.md
arch-page-object-model.md
arch-parallel-execution.md
arch-test-isolation.md
arch-test-production.md
auth-api-login.md
auth-multiple-roles.md
auth-parallel-workers.md
auth-session-storage.md
auth-storage-state.md
debug-ci-reporters.md
debug-inspector.md
debug-screenshots-videos.md
debug-trace-viewer.md
loc-avoid-xpath.md
loc-chained-locators.md
loc-data-testid.md
loc-label-selectors.md
loc-placeholder-selector.md
loc-role-selectors.md
loc-text-selectors.md
mock-abort-requests.md
mock-api-responses.md
mock-har-files.md
mock-intercept-modify.md

Details

From the project README

Playwright + Next.js Testing Best Practices

Comprehensive testing optimization guide for Playwright with Next.js applications. Contains 43 rules across 8 categories, prioritized by impact to guide reliable, fast, and maintainable E2E tests.

When to Apply

Reference these guidelines when:

  • Writing new Playwright tests for Next.js apps
  • Debugging flaky or failing tests
  • Optimizing test execution speed
  • Setting up authentication state reuse
  • Configuring CI/CD pipelines for testing
  • Testing Server Components and App Router features
  • Reviewing test code for reliability issues

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Test ArchitectureCRITICALarch-
2Selectors & LocatorsCRITICALloc-
3Waiting & AssertionsHIGHwait-
4Authentication & StateHIGHauth-
5Mocking & NetworkMEDIUM-HIGHmock-
6Next.js IntegrationMEDIUMnext-
7Performance & SpeedMEDIUMperf-
8Debugging & CILOW-MEDIUMdebug-

Quick Reference

1. Test Architecture (CRITICAL)
2. Selectors & Locators (CRITICAL)
3. Waiting & Assertions (HIGH)
4. Authentication & State (HIGH)
5. Mocking & Network (MEDIUM-HIGH)
6. Next.js Integration (MEDIUM)
7. Performance & Speed (MEDIUM)
8. Debugging & CI (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
AGENTS.mdComplete compiled guide with all rules
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported