Use when setting up Playwright test projects and organizing test suites with proper configuration and project structure.
View on GitHubTheBushidoCollective/han
jutsu-playwright
January 24, 2026
Select agents to install to:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/jutsu/jutsu-playwright/skills/playwright-test-architecture/SKILL.md -a claude-code --skill playwright-test-architectureInstallation paths:
.claude/skills/playwright-test-architecture/# Playwright Test Architecture
Master test organization, configuration, and project structure for scalable
and maintainable Playwright test suites. This skill covers best practices
for organizing tests, configuring projects, and optimizing test execution.
## Installation and Setup
```bash
# Install Playwright with browsers
npm init playwright@latest
# Install specific browsers
npx playwright install chromium firefox webkit
# Install dependencies only
npm install -D @playwright/test
# Update Playwright
npm install -D @playwright/test@latest
npx playwright install
# Show installed version
npx playwright --version
```
## Project Configuration
### Basic Configuration
**playwright.config.ts:**
```typescript
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
// Test directory
testDir: './tests',
// Test timeout (30 seconds default)
timeout: 30000,
// Expect timeout for assertions
expect: {
timeout: 5000,
},
// Run tests in files in parallel
fullyParallel: true,
// Fail the build on CI if you accidentally left test.only
forbidOnly: !!process.env.CI,
// Retry on CI only
retries: process.env.CI ? 2 : 0,
// Reporter configuration
reporter: 'html',
// Shared settings for all projects
use: {
// Base URL for navigation
baseURL: 'http://localhost:3000',
// Collect trace on first retry
trace: 'on-first-retry',
// Screenshot on failure
screenshot: 'only-on-failure',
// Video on retry
video: 'retain-on-failure',
},
// Configure projects for major browsers
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
// Run local dev server before starting tests
webServer: {
command: 'npm run start',
url: 'http://localhost:3000',
reuseExi