/ 디렉터리 / 플레이그라운드 / playwright-skill
● 커뮤니티 testdino-hq ⚡ 바로 사용

playwright-skill

제작: testdino-hq · testdino-hq/playwright-skill

Claude Code skill teaching Playwright best practices — locators, network stubbing, trace viewer, parallelism — from the TestDino team.

TestDino Playwright Skill primes Claude Code with Playwright-first testing patterns: role-based locators, network stubbing, fixtures, trace capture, parallelism, retries, auth state reuse. Built from TestDino's test-platform experience, it biases Claude's code generation toward maintainable E2E tests.

왜 쓰나요

핵심 기능

라이브 데모

실제 사용 모습

playwright-skill-2.replay ▶ 준비됨
0/0

설치

클라이언트 선택

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "playwright-skill-2": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/testdino-hq/playwright-skill",
        "~/.claude/skills/playwright-skill"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config 열기. 저장 후 앱 재시작.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "playwright-skill-2": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/testdino-hq/playwright-skill",
        "~/.claude/skills/playwright-skill"
      ],
      "_inferred": true
    }
  }
}

Cursor는 Claude Desktop과 동일한 mcpServers 스키마 사용. 프로젝트 설정이 전역보다 우선.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "playwright-skill-2": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/testdino-hq/playwright-skill",
        "~/.claude/skills/playwright-skill"
      ],
      "_inferred": true
    }
  }
}

Cline 사이드바의 MCP Servers 아이콘 클릭 후 "Edit Configuration" 선택.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "playwright-skill-2": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/testdino-hq/playwright-skill",
        "~/.claude/skills/playwright-skill"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop과 같은 형식. Windsurf 재시작 후 적용.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "playwright-skill-2",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/testdino-hq/playwright-skill",
        "~/.claude/skills/playwright-skill"
      ]
    }
  ]
}

Continue는 맵이 아닌 서버 오브젝트 배열 사용.

~/.config/zed/settings.json
{
  "context_servers": {
    "playwright-skill-2": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/testdino-hq/playwright-skill",
          "~/.claude/skills/playwright-skill"
        ]
      }
    }
  }
}

context_servers에 추가. 저장 시 Zed가 핫 리로드.

claude mcp add playwright-skill-2 -- git clone https://github.com/testdino-hq/playwright-skill ~/.claude/skills/playwright-skill

한 줄 명령. claude mcp list로 확인, claude mcp remove로 제거.

사용 사례

실전 활용법: playwright-skill

How to write a maintainable first E2E test

👤 Developers adding Playwright to a project for the first time ⏱ ~30 min beginner

언제 쓸까: You have a staging URL and a login flow; you want one solid test before scaling.

사전 조건
  • Skill installed — git clone https://github.com/testdino-hq/playwright-skill ~/.claude/skills/playwright-skill
  • @playwright/test installed — npm init playwright@latest
흐름
  1. Describe the flow
    Write a Playwright test for login at staging.example.com: email, password, expect dashboard heading. Use role-based locators only.✓ 복사됨
    → Test using getByRole, getByLabel; no .class or xpath
  2. Add auth reuse fixture
    Convert the login into a reusable auth fixture so other tests skip logging in.✓ 복사됨
    → storageState-based fixture + globalSetup
  3. Ensure non-flakiness
    Audit the test for waitFor* anti-patterns; switch to web-first assertions.✓ 복사됨
    → expect(locator).toBeVisible() rather than waitForSelector

결과: A robust first test plus a fixture the whole suite inherits.

함정
  • Claude reaches for page.waitForTimeout — Tell skill explicitly: no arbitrary waits, use web-first assertions

Stub a backend API to test frontend edge cases

👤 Frontend engineers testing empty/error/loading states ⏱ ~25 min intermediate

언제 쓸까: You can't easily put the real backend into each state.

흐름
  1. Stub the endpoint
    Stub GET /api/orders to return empty array, then assert the empty state renders.✓ 복사됨
    → route.fulfill with JSON body; assertion on empty-state element
  2. Vary responses per test
    Parameterize the stub: one test for 500 error, one for timeout, one for partial data.✓ 복사됨
    → Three tests sharing a helper

결과: Edge-state coverage without touching the backend.

함정
  • Stub leaks across tests — Set up in beforeEach or fixture scope, not in a module-level hook

Debug a flaky test using trace viewer

👤 Engineers triaging a flaky suite in CI ⏱ ~45 min intermediate

언제 쓸까: A test passes locally, fails 5% of the time in CI.

흐름
  1. Capture trace on retry
    Configure trace: 'on-first-retry' in playwright.config.ts.✓ 복사됨
    → Config diff
  2. Analyze the trace
    Download the trace.zip from the failed CI run; walk me through what's different from the successful run.✓ 복사됨
    → Concrete diff in network/DOM timing
  3. Fix
    Based on the trace, propose the minimal change to de-flake.✓ 복사됨
    → Specific locator or assertion change, not a blanket sleep

결과: A de-flaked test with a documented root cause.

함정
  • Treating flakes by bumping timeouts — Most flakes are hidden race conditions — the trace usually reveals a missing await

조합

다른 MCP와 조합해 10배 효율

playwright-skill-2 + seo-audit-skill

Playwright captures pages, SEO audit runs against rendered HTML for JS-heavy apps

Use Playwright to authenticate and capture logged-in pages, then run seo-audit against each.✓ 복사됨

도구

이 MCP가 노출하는 것

도구입력언제 호출비용
Locator patterns - Writing new selectors 0
Network stubbing - Testing frontend edge states 0
Fixtures & auth reuse - Scaling a suite past 5 tests 0
Trace analysis trace.zip Debugging flakes 0
Parallelism & sharding - Suites running >5 min in CI 0

비용 및 제한

운영 비용

API 쿼터
None
호출당 토큰
Test generation: 3-8k tokens
금액
Free
Generate one test manually, save as a template, and have Claude follow the template for others.

보안

권한, 시크릿, 파급범위

자격 증명 저장: Test credentials in .env (via dotenv). Never commit storageState.json with production auth.
데이터 외부 송신: Tests hit your target URL. No third-party calls from the skill.

문제 해결

자주 발생하는 오류와 해결

Test is flaky on CI only

Enable trace: 'on-first-retry' and analyze the trace from the failing attempt.

확인: npx playwright show-trace trace.zip
getByRole doesn't find an element that's clearly there

Element may lack an accessible name. Use Playwright Inspector to see the computed role/name.

확인: npx playwright test --ui
Login fixture works locally, fails in CI

CI may need --headed=false and explicit browser install. Run npx playwright install --with-deps in CI.

대안

playwright-skill 다른 것과 비교

대안언제 쓰나단점/장점
CypressYou prefer Cypress's DX and real-browser debuggingDifferent locator philosophy; less parallelism

더 보기

리소스

📖 GitHub에서 공식 README 읽기

🐙 열린 이슈 보기

🔍 400+ MCP 서버 및 Skills 전체 보기