Webapp Testing

作成者: Anthropic

Playwrightを使用してローカルWebアプリケーションと対話し、テストするためのツールキット。フロントエンド機能の検証、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
社内で好んで使用されるフォーマットを活用し、あらゆる種類の社内コミュニケーションを作成するためのリソースセットです。ステータスレポート、リーダーシップ向けアップデート、3Pアップデート、社内ニュースレター、FAQ、インシデントレポート、プロジェクトアップデートなど、社内コミュニケーションの作成を依頼された際には、このスキルを使用する必要があります。 ライセンス:LICENSE.txtに完全な利用規約が記載されています。
official
MCP Builder
Anthropic
高品質なMCP(Model Context Protocol)サーバーを作成するためのガイド。LLMが適切に設計されたツールを通じて外部サービスと連携できるようにします。外部APIやサービスを統合するMCPサーバーを構築する際に使用します。Python(FastMCP)またはNode/TypeScript(MCP SDK)のいずれでも対応可能です。 ライセンス:LICENSE.txtに完全な利用規約が記載されています。
developmentofficial
Artifacts Builder
Anthropic
モダンなフロントエンドWeb技術(React、Tailwind CSS、shadcn/ui)を使用して、複雑で多要素からなるclaude.ai HTMLアーティファクトを作成するためのツールスイート。状態管理、ルーティング、またはshadcn/uiコンポーネントを必要とする複雑なアーティファクトに使用します。単純な単一ファイルのHTML/JSXアーティファクトには使用しません。 ライセンス:LICENSE.txtに完全な利用規約あり
development