mcpField
P
playwright

playwright

github.com/pymodelTesting & quality40492 installsUpdated 4w ago
Repository

About playwright

A reference skill for writing and maintaining Playwright end-to-end tests in Next.js applications. It organizes 45 prioritized rules into eight areas, from test structure and selectors to debugging and CI.

Key features

  1. 0145 rules in eight categories
  2. 02Guidance for test isolation and architecture
  3. 03Selector and assertion practices
  4. 04Authentication state reuse
  5. 05Network mocking and Next.js testing
  6. 06Performance, debugging, and CI guidance

Use cases

  1. 01Writing Playwright tests for Next.js apps
  2. 02Investigating flaky or failing tests
  3. 03Reusing authentication state across tests
  4. 04Reviewing test code and CI settings

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pymodel/react-frontend-skills --skill playwright

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

Bundled files

References and scripts installed along with SKILL.md.

references/
arch-cleanup-state.md
arch-fixtures.md
arch-page-object-model.md
arch-parallel-execution.md
arch-test-isolation.md
arch-test-production.md
assert-aria-snapshots.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-frame-locator.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
mock-network-conditions.md
next-app-router-navigation.md

Details

From the project README

Playwright + Next.js Testing Best Practices

Comprehensive testing optimization guide for Playwright with Next.js applications. Contains 45 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

Run in the project root first:

npx -y @pymodel/react-frontend-skills detect                   # installed vs. targeted versions
npx -y @pymodel/react-frontend-skills scan --skill playwright  # deprecated APIs → rule IDs

Read references/<rule-id>.md for each rule above that matches the task and for each scan hit: why it matters, then incorrect vs. correct code.

Comments

Markdown supported