Playwright testing best practices for Next.js applications (formerly test-playwright).
This skill should be used when writing, reviewing, or debugging E2E tests with Playwright.
Triggers on tasks involving test selectors, flaky tests, authentication state, API mocking, hydration testing, parallel execution, CI configuration, or debugging test failures.
Similar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Claude CodeNot declared
CursorNot declared
CodexNot declared
GitHub CopilotNot declared
WindsurfNot declared
Gemini CLINot declared
ClineNot declared
OpenCodeNot declared
Repository health
Stars3
LicenseLICENSE
Default branchmain
Open issues0
Status
Active
Package contents
Files included with this skill beyond the listing page.
skill mdSKILL.md6,516 B
docsSUMMARY.md372 B
History
First seen on skills.sh
First recorded snapshot · 120 installs
SKILL.md
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
Priority
Category
Impact
Prefix
1
Test Architecture
CRITICAL
arch-
2
Selectors & Locators
CRITICAL
loc-
3
Waiting & Assertions
HIGH
wait-
4
Authentication & State
HIGH
auth-
5
Mocking & Network
MEDIUM-HIGH
mock-
6
Next.js Integration
MEDIUM
next-
7
Performance & Speed
MEDIUM
perf-
8
Debugging & CI
LOW-MEDIUM
debug-
Quick Reference
1. Test Architecture (CRITICAL)
[arch-test-isolation](references/arch-test-isolation.md) - Use fresh browser context for each test
[arch-parallel-execution](references/arch-parallel-execution.md) - Enable parallel test execution
[arch-page-object-model](references/arch-page-object-model.md) - Use Page Object Model for complex pages
[arch-fixtures](references/arch-fixtures.md) - Use fixtures for shared setup
[arch-test-production](references/arch-test-production.md) - Test against production builds
[arch-cleanup-state](references/arch-cleanup-state.md) - Clean up test state after each test
2. Selectors & Locators (CRITICAL)
[loc-role-selectors](references/loc-role-selectors.md) - Use role-based selectors over CSS
[loc-data-testid](references/loc-data-testid.md) - Use data-testid for dynamic elements
[loc-label-selectors](references/loc-label-selectors.md) - Use getByLabel for form inputs
[loc-text-selectors](references/loc-text-selectors.md) - Use getByText for static content