mcpField
P
playwright

playwright

github.com/thongdn-itTesting & quality5103 installsUpdated 40w ago
Repository

About playwright

A reference skill with 43 prioritized rules for testing Next.js applications with Playwright. It helps developers write and maintain reliable end-to-end tests, with guidance on selectors, waiting, authentication, network mocking, Next.js behavior, performance, and debugging.

Key features

  1. 0143 rules across eight categories
  2. 02Guidance on test architecture and locators
  3. 03Recommendations for waits and assertions
  4. 04Authentication and state reuse patterns
  5. 05Network mocking and Next.js testing
  6. 06Performance, debugging, and CI practices

Use cases

  1. 01Create end-to-end tests for a Next.js app
  2. 02Investigate flaky or failing tests
  3. 03Reuse authentication state across tests
  4. 04Improve test execution and CI debugging

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thongdn-it/react-agent-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