What problem does it solve?
This Skill streamlines the process of writing, reviewing, and debugging end-to-end tests for Next.js applications using Playwright. It addresses challenges related to test reliability, speed, and maintainability in complex web environments.
Core Features & Use Cases
- Test Architecture Optimization: Guides on creating isolated, parallel, and robust test setups for Next.js apps.
- Locator Strategies: Promotes stable, role-based, and data-testid selectors to enhance test stability.
- Waiting & Assertions: Implements auto-retry assertions and best practices for synchronization.
- Authentication & State Management: Reuses authentication states to reduce overhead and enable role-based testing.
- Mocking & Network Control: Enables API response mocking, HAR replay, and network condition simulation for deterministic tests.
- Next.js Specific Testing: Verifies hydration, server components, app router behaviors, and server actions.
- Performance Optimization: Utilizes sharding, headless mode, and server reuse to speed up test runs.
- Debugging & CI: Facilitates trace viewing, screenshot capture, inspector tool, and CI reporter configuration.
Quick Start
Use the playwright skill to improve test reliability by applying auto-wait assertions, mocking network requests, and managing authentication states for Next.js apps.