pw-init
하는 일
이 스킬은 에이전트가 프로젝트에 Playwright를 설치하고 설정하게 합니다. 작동하는 설정을 빨리 갖추고 싶은 브라우저 테스트 입문 개발자를 위한 스킬입니다.
사용하는 경우
- ✓새 프로젝트를 시작하면서 처음부터 브라우저 테스트를 원할 때.
- ✓프로젝트에 엔드 투 엔드 테스트가 아직 없을 때.
- ✓브라우저 테스트를 위한 준비된 CI 워크플로가 필요할 때.
스킬 링크
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/pw-init/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“기본 설정과 예제 테스트 하나로 제 프로젝트에 Playwright를 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 프로젝트의 프레임워크, 언어, 기존 테스트 폴더를 확인합니다. 그다음 Playwright를 설치하고, 프레임워크에 맞는 설정을 쓰며, 첫 테스트와 CI 워크플로를 추가합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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.jsonfor framework (React, Next.js, Vue, Angular, Svelte) - Check for
tsconfig.json→ use TypeScript; otherwise JavaScript - Check if Playwright is already installed (
@playwright/testin 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:
npm init playwright@latest -- --quiet
Or if the user prefers manual setup:
npm install -D @playwright/test
npx playwright install --with-deps chromium
3. Generate playwright.config.ts
Adapt to the detected framework:
Next.js:
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: { ...devices['Desktop Firefox'] } },
{ name: "webkit", use: { ...devices['Desktop Safari'] } },
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
});
React (Vite):
- Change
baseURLtohttp://localhost:5173 - Change
webServer.commandtonpm run dev
Vue/Nuxt:
- Change
baseURLtohttp://localhost:3000 - Change
webServer.commandtonpm run dev
Angular:
- Change
baseURLtohttp://localhost:4200 - Change
webServer.commandtonpm run start
No framework detected:
- Omit
webServerblock - Set
baseURLfrom user input or leave as placeholder
4. Create Folder Structure
e2e/
├── fixtures/
│ └── index.ts # Custom fixtures
├── pages/
│ └── .gitkeep # Page object models
├── test-data/
│ └── .gitkeep # Test data files
└── example.spec.ts # First example test
5. Generate Example Test
import { test, expect } from '@playwright/test';
test.describe('Homepage', () => {
test('should load successfully', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/.+/);
});
test('should have visible navigation', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('navigation')).toBeVisible();
});
});
6. Generate CI Workflow
If .github/workflows/ exists, create playwright.yml:
name: "playwright-tests"
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: "install-dependencies"
run: npm ci
- name: "install-playwright-browsers"
run: npx playwright install --with-deps
- name: "run-playwright-tests"
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: "playwright-report"
path: playwright-report/
retention-days: 30
If .gitlab-ci.yml exists, add a Playwright stage instead.
7. Update .gitignore
Append if not already present:
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
8. Add npm Scripts
Add to package.json scripts:
{
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:debug": "playwright test --debug"
}
9. Verify Setup
Run the example test:
npx playwright test
Report the result. If it fails, diagnose and fix before completing.
Output
Confirm what was created:
- Config file path and key settings
- Test directory and example test
- CI workflow (if applicable)
- npm scripts added
- How to run:
npx playwright testornpm run test:e2e
자주 묻는 질문
어떤 프레임워크에 맞추나요?
Next.js, React, Vue, Angular, Svelte 같은 프레임워크를 위한 설정 안내가 있습니다.
이미 테스트가 있다면요?
이 스킬은 먼저 기존 테스트 폴더와 기존 Playwright 설치를 확인해, 이미 있는 것에 맞춥니다.
직접 설치하고 싶다면요?
대안으로 수동 설치 명령도 함께 안내합니다.
상세 정보
작성자의 원본 설명
Use when setting up Playwright in a project ('set up playwright', 'add e2e tests', 'configure playwright', 'init playwright').
인기도
- GitHub 스타
- 29k
- 순위
- #9477
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-launcher-orchestrator
29k하나의 명확한 목표에서 시작해 내 계정의 Claude 관리형 에이전트를 계획하고, 만들고, 테스트하고, 예약하도록 돕습니다.
grade-iterate
29k에이전트가 채점 기준표에 따라 관리형 AI 에이전트의 결과물을 평가하고, 정해진 횟수 안에서 개선하도록 돕습니다. 끝없이 반복하지 않습니다.
interview
29kAI 에이전트 아이디어에 대해 질문하고, 답변을 간단한 빌드 계획으로 바꿔 어떤 것도 출시하기 전에 정리하도록 돕습니다.
run-without-you
29k에이전트가 관리형 AI 에이전트를 예약 또는 이벤트에 따라 실행되도록 설정하고, 출시 전에 cron 시간을 확인하도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.