Webapp Testing

작성자: Anthropic

Playwright를 사용하여 로컬 웹 애플리케이션과 상호작용하고 테스트하기 위한 툴킷입니다. 프론트엔드 기능 확인, UI 동작 디버깅, 브라우저 스크린샷 캡처, 브라우저 로그 보기를 지원합니다. 라이선스: LICENSE.txt에 전체 약관이 명시되어 있습니다.

npx skills add https://github.com/anthropics/skills --skill webapp-testing

Web Application Testing

To test local web applications, write native Python Playwright scripts.

Helper Scripts Available:

  • scripts/with_server.py - Manages server lifecycle (supports multiple servers)

Always run scripts with --help first to see usage. DO NOT read the source until you try running the script first and find that a customized solution is abslutely necessary. These scripts can be very large and thus pollute your context window. They exist to be called directly as black-box scripts rather than ingested into your context window.

Decision Tree: Choosing Your Approach

User task → Is it static HTML?
    ├─ Yes → Read HTML file directly to identify selectors
    │         ├─ Success → Write Playwright script using selectors
    │         └─ Fails/Incomplete → Treat as dynamic (below)
    │
    └─ No (dynamic webapp) → Is the server already running?
        ├─ No → Run: python scripts/with_server.py --help
        │        Then use the helper + write simplified Playwright script
        │
        └─ Yes → Reconnaissance-then-action:
            1. Navigate and wait for networkidle
            2. Take screenshot or inspect DOM
            3. Identify selectors from rendered state
            4. Execute actions with discovered selectors

Example: Using with_server.py

To start a server, run --help first, then use the helper:

Single server:

python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py

Multiple servers (e.g., backend + frontend):

python scripts/with_server.py \
  --server "cd backend && python server.py" --port 3000 \
  --server "cd frontend && npm run dev" --port 5173 \
  -- python your_automation.py

To create an automation script, include only Playwright logic (servers are managed automatically):

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode
    page = browser.new_page()
    page.goto('http://localhost:5173') # Server already running and ready
    page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute
    # ... your automation logic
    browser.close()

Reconnaissance-Then-Action Pattern

  1. Inspect rendered DOM:

    page.screenshot(path='/tmp/inspect.png', full_page=True)
    content = page.content()
    page.locator('button').all()
    
  2. Identify selectors from inspection results

  3. Execute actions using discovered selectors

Common Pitfall

Don't inspect the DOM before waiting for networkidle on dynamic apps ✅ Do wait for page.wait_for_load_state('networkidle') before inspection

Best Practices

  • Use bundled scripts as black boxes - To accomplish a task, consider whether one of the scripts available in scripts/ can help. These scripts handle common, complex workflows reliably without cluttering the context window. Use --help to see usage, then invoke directly.
  • Use sync_playwright() for synchronous scripts
  • Always close the browser when done
  • Use descriptive selectors: text=, role=, CSS selectors, or IDs
  • Add appropriate waits: page.wait_for_selector() or page.wait_for_timeout()

Reference Files

  • examples/ - Examples showing common patterns:
    • element_discovery.py - Discovering buttons, links, and inputs on a page
    • static_html_automation.py - Using file:// URLs for local HTML
    • console_logging.py - Capturing console logs during automation

Anthropic의 다른 스킬

Algorithmic Art
Anthropic
p5.js와 시드 기반 무작위성 및 대화형 매개변수 탐색을 사용하여 알고리즘 아트를 생성합니다. 사용자가 코드를 사용한 아트 생성, 제너레이티브 아트, 알고리즘 아트, 플로우 필드 또는 파티클 시스템을 요청할 때 사용하세요. 저작권 침해를 피하기 위해 기존 아티스트의 작품을 복사하지 않고 독창적인 알고리즘 아트를 만드세요. 라이선스: 전체 약관은 LICENSE.txt에 있습니다.
creativeofficial
Brand Guidelines
Anthropic
Anthropic의 공식 브랜드 색상과 타이포그래피를 적용하여 Anthropic의 느낌을 살리는 데 도움이 되는 모든 아티팩트에 사용합니다. 브랜드 색상이나 스타일 가이드, 시각적 서식, 회사 디자인 표준이 적용될 때 사용하세요. 라이선스: LICENSE.txt에 전체 약관이 명시되어 있습니다.
creativeofficial
Canvas Design
Anthropic
디자인 철학을 사용하여 .png 및 .pdf 문서로 아름다운 시각 예술을 만듭니다. 사용자가 포스터, 예술 작품, 디자인 또는 기타 정적 작품을 요청할 때 이 스킬을 사용해야 합니다. 저작권 침해를 피하기 위해 기존 아티스트의 작품을 복사하지 않고 독창적인 시각 디자인을 만듭니다. 라이선스: LICENSE.txt에 전체 약관이 명시되어 있습니다.
creativeofficial
Docx
Anthropic
포괄적인 문서 생성, 편집 및 분석 기능을 제공하며, 변경 내용 추적, 주석, 서식 유지, 텍스트 추출을 지원합니다. Claude가 전문 문서(.docx 파일) 작업이 필요할 때: (1) 새 문서 생성, (2) 콘텐츠 수정 또는 편집, (3) 변경 내용 추적 작업, (4) 주석 추가 또는 기타 문서 작업에 사용됩니다. 라이선스: 독점 라이선스. LICENSE.txt에 전체 조건이 명시되어 있습니다.
documentofficial
Frontend Design
Anthropic
독창적이고 프로덕션 수준의 프론트엔드 인터페이스를 생성하여 일반적인 AI 미학을 피합니다.
developmentfeaturedofficial
Internal Comms
Anthropic
회사가 선호하는 형식을 사용하여 모든 종류의 내부 커뮤니케이션을 작성하는 데 도움이 되는 리소스 세트입니다. Claude는 상태 보고서, 리더십 업데이트, 3P 업데이트, 회사 뉴스레터, FAQ, 사고 보고서, 프로젝트 업데이트 등 내부 커뮤니케이션 작성을 요청받을 때마다 이 스킬을 사용해야 합니다. 라이선스: LICENSE.txt에 전체 약관이 명시되어 있습니다.
official
MCP Builder
Anthropic
고품질 MCP(Model Context Protocol) 서버를 생성하기 위한 가이드로, 잘 설계된 도구를 통해 LLM이 외부 서비스와 상호작용할 수 있도록 합니다. Python(FastMCP) 또는 Node/TypeScript(MCP SDK)로 외부 API나 서비스를 통합하는 MCP 서버를 구축할 때 사용하세요. 라이선스: LICENSE.txt에 전체 약관이 명시되어 있습니다.
developmentofficial
Artifacts Builder
Anthropic
현대 프론트엔드 웹 기술(React, Tailwind CSS, shadcn/ui)을 사용하여 정교한 다중 구성 요소 claude.ai HTML 아티팩트를 생성하기 위한 도구 모음입니다. 상태 관리, 라우팅 또는 shadcn/ui 구성 요소가 필요한 복잡한 아티팩트에 사용하십시오. 단순한 단일 파일 HTML/JSX 아티팩트에는 적합하지 않습니다. 라이선스: LICENSE.txt에 전체 약관이 명시되어 있습니다.
development