/ Diretório / Playground / playwright-skill
● Comunidade lackeyjb ⚡ Instantâneo

playwright-skill

por lackeyjb · lackeyjb/playwright-skill

Claude writes and runs custom Playwright scripts on-demand — headed browser, real output — no pre-baked test library to memorize.

Rather than shipping fixed helper functions, this skill teaches Claude to write bespoke Playwright code per task and execute it via run.js. The browser runs visibly by default so you can watch. Playwright API docs load on-demand so Claude has context without blowing the window.

Por que usar

Principais recursos

Demo ao vivo

Como fica na prática

playwright-skill.replay ▶ pronto
0/0

Instalar

Escolha seu cliente

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

Abra Claude Desktop → Settings → Developer → Edit Config. Reinicie após salvar.

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

Cursor usa o mesmo esquema mcpServers que o Claude Desktop. Config de projeto vence a global.

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

Clique no ícone MCP Servers na barra lateral do Cline, depois "Edit Configuration".

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

Mesmo formato do Claude Desktop. Reinicie o Windsurf para aplicar.

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

O Continue usa um array de objetos de servidor em vez de um map.

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

Adicione em context_servers. Zed recarrega automaticamente ao salvar.

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

Uma linha só. Verifique com claude mcp list. Remova com claude mcp remove.

Casos de uso

Usos do mundo real: playwright-skill

Write a smoke test for a signup flow on demand

👤 Developers who want a test without hand-writing Playwright ⏱ ~10 min beginner

Quando usar: You pushed a new signup flow and want to know it still works end-to-end.

Pré-requisitos
  • Node + Playwright installable — The skill will install browsers via npx playwright install if missing
Fluxo
  1. Describe the flow
    Use the playwright skill. Open localhost:3000, sign up with [email protected] / Pass123!, verify we land on /dashboard.✓ Copiado
    → Claude writes a Playwright script, runs it headed, reports pass/fail
  2. Debug failures interactively
    It failed at the email input — add a screenshot right before the error.✓ Copiado
    → Next run captures and returns the screenshot

Resultado: A one-off smoke test you can optionally save as a persistent spec.

Armadilhas
  • Selectors chosen are brittle (e.g. nth-child) — Ask Claude to prefer role/label selectors
Combine com: filesystem

Spot-check responsive rendering across 3 viewports

👤 Frontend devs validating a layout change ⏱ ~5 min beginner

Quando usar: You changed the header and want to see how it renders on desktop, tablet, and mobile.

Fluxo
  1. Request screenshots
    Use playwright to screenshot localhost:3000 at 1440, 768, and 390 width. Save them.✓ Copiado
    → 3 PNGs saved and paths returned

Resultado: Three screenshots for quick visual review.

Armadilhas
  • Screenshots don't wait for fonts/images — Add a networkidle wait before snapping
Combine com: filesystem

Combinações

Combine com outros MCPs para 10× de alavancagem

playwright-skill + filesystem

Save test specs and screenshots alongside the code they test

Write the smoke test and save it under tests/e2e/signup.spec.js.✓ Copiado
playwright-skill + github

Run the test, fail the workflow, post results on the PR

Run the playwright spec against the deploy preview, then post results as a comment on PR #42.✓ Copiado
playwright-skill + ios-simulator-skill

Playwright for web, ios-simulator-skill for native — use both in a cross-platform test session

Run the playwright web flow and the ios-simulator native flow in sequence, report both.✓ Copiado

Ferramentas

O que este MCP expõe

FerramentaEntradasQuando chamarCusto
Custom Playwright script generation task description Any browser automation ask 0
run.js executor script path After script generation 0
Headed/headless toggle flag CI vs local debugging 0

Custo e limites

O que custa rodar

Cota de API
None
Tokens por chamada
1-5k per test run, depending on how much Playwright reference Claude pulls in
Monetário
Free — you only need Node + Playwright browsers on disk
Dica
Keep prompts focused; don't ask for 'test everything' in one shot.

Segurança

Permissões, segredos, alcance

Armazenamento de credenciais: No credentials in the skill. If your tests hit authenticated pages, keep creds in env vars — never in the generated script.
Saída de dados: Only to sites your test visits

Solução de problemas

Erros comuns e correções

'browserType.launch: Executable doesn't exist'

Run npx playwright install chromium

Verificar: npx playwright --version
Selector fails intermittently

Switch to role/label selectors; add await expect(...).toBeVisible() waits.

Script hangs

Claude likely forgot to close the browser. Tell it to always wrap in try/finally with await browser.close().

Alternativas

playwright-skill vs. outros

AlternativaQuando usarTroca
playwright MCPYou want structured MCP tools (click, fill, snapshot) rather than code generationMCP abstracts away code; this skill writes real scripts you can reuse
Puppeteer skills / chrome-devtools MCPChrome-only workflows, DevTools protocol featuresLess cross-browser

Mais

Recursos

📖 Leia o README oficial no GitHub

🐙 Ver issues abertas

🔍 Ver todos os 400+ servidores MCP e Skills