init

Solid

Set up Playwright in a project. Use when user says "set up playwright", "add e2e tests", "configure playwright", "testing setup", "init playwright", or "add test infrastructure".

AI & Automation 16,642 stars 2295 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Initialize Playwright Project Set up a production-ready Playwright testing environment. Detect the framework, generate config, folder structure, example test, and CI workflow. ## Steps ### 1. Analyze the Project Use the `Explore` subagent to scan the project: - Check `package.json` for framework (React, Next.js, Vue, Angular, Svelte) - Check for `tsconfig.json` → use TypeScript; otherwise JavaScript - Check if Playwright is already installed (`@playwright/test` in dependencies) - Check for existing test directories (`tests/`, `e2e/`, `__tests__/`) - Check for existing CI config (`.github/workflows/`, `.gitlab-ci.yml`) ### 2. Install Playwright If not already installed: ```bash npm init playwright@latest -- --quiet ``` Or if the user prefers manual setup: ```bash npm install -D @playwright/test npx playwright install --with-deps chromium ``` ### 3. Generate `playwright.config.ts` Adapt to the detected framework: **Next.js:** ```typescript import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './e2e', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: [ ['html', { open: 'never' }], ['list'], ], use: { baseURL: 'http://localhost:3000', trace: 'on-first-retry', screenshot: 'only-on-failure', }, projects: [ { name: "chromium", use: { ...devices['Desktop Chrome'] } }, { name: "firefox", use: { ...

Details

Author
alirezarezvani
Repository
alirezarezvani/claude-skills
Created
7 months ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category