This is a comprehensive rulebook for writing Playwright tests in Next.js apps, with 43 rules organized by priority from critical (test isolation, role-based selectors) to helpful (debugging config). You'd reach for this when setting up E2E tests, debugging flaky failures, or optimizing CI runs. The authentication state reuse patterns alone will save you minutes per test run. It's opinionated about avoiding XPath and hard waits, which is good because those are real footguns. The Next.js specific guidance covers hydration testing and App Router navigation, stuff that's easy to get wrong if you're coming from traditional client-side testing. Heavy on best practices, light on hand-holding, which feels right for a reference guide you'll actually consult mid-task.

skills.sh installs
1.2K
GitHub stars
222
last updated
Aug 21, 2026

Install

$ npx -y skills add pproenca/dot-skills --skill playwright --agent claude-code

Installs into .claude/skills of the current project.

Files

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)

Sponsors

Details

Repository
github.com/pproenca/dot-skills
Categories
Frontend Development, Backend & APIs, Testing & QA, Security, Documentation, Debugging, Automation & Workflows
First seen
Jun 3, 2026

More from pproenca/dot-skills

All 100
1vtex avatarheadless-bff-architecturevtex/skillsApply when designing or modifying a BFF (Backend-for-Frontend) layer, middleware, or API proxy for a headless VTEX storefront. Covers BFF middleware architectur1.2Kskills.sh installs
2vintasoftware avatardjango-celery-expertvintasoftware/django-ai-pluginsExpert Django Celery guidance for asynchronous task processing. Use when designing background tasks, configuring Celery workers, handling task retries and error1.2Kskills.sh installs
3openai avatardocopenai/skillsUse when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the1.2Kskills.sh installs
4kostja94 avatarcore-web-vitalskostja94/marketing-skillsWhen the user wants to optimize Core Web Vitals, fix LCP, INP, or CLS issues. Also use when the user mentions "Core Web Vitals," "CWV," "LCP," "INP," "CLS," "FI1.1Kskills.sh installs
5kar2phi avatarvideo-lenskar2phi/video-lensFetch a YouTube transcript and generate an executive summary, key points, and timestamped topic list as a polished HTML report. Activate on YouTube URLs or requ1.1Kskills.sh installs
6vtex avatarheadless-checkout-proxyvtex/skillsApply when implementing cart, checkout, or order placement logic proxied through a BFF for headless VTEX storefronts. Covers OrderForm lifecycle, cart creation,1.1Kskills.sh installs