webapp-testing
БесплатноЗапускает вложенные скриптыНе проверенTest local web applications using Playwright with Python. Verify frontend functionality, debug UI behavior, capture screenshots, and view browser console…
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
Web Application Testing Skill
Overview
This skill adapts Anthropic's webapp-testing skill for the agent-studio framework. It provides a systematic approach to testing web applications locally using Playwright, choosing the right strategy based on the type of web content being tested.
Source repository: https://github.com/anthropics/skills
License: MIT
Tool: Playwright (Python API)
When to Use
- When verifying frontend functionality of a web application
- When debugging UI behavior or visual rendering issues
- When capturing screenshots for visual regression testing
- When checking browser console for JavaScript errors
- When testing form submissions, navigation flows, and interactive elements
- When generating automated test scripts for web applications
Iron Law
NEVER INSPECT DOM BEFORE WAITING FOR NETWORKIDLE ON DYNAMIC APPS
Dynamic web applications load content asynchronously. Inspecting the DOM before the page has stabilized will produce incorrect or incomplete results. Always call page.wait_for_load_state('networkidle') before inspecting rendered content on dynamic apps.
Decision Tree: Choose Your Approach
Is the target a static HTML file?
YES → Approach A: Direct Read
NO → Is there a running dev server?
YES → Approach B: Reconnaissance-then-Action
NO → Approach C: Helper Script First
Approach A: Static HTML Files
For static HTML files that do not require a server:
- Read the HTML file directly
- Identify CSS selectors for elements of interest
- Write a Playwright script to open the file and verify content
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto(f"file://{abs_path_to_html}")
# Verify content
title = page.title()
assert title == "Expected Title"
# Check element exists
element = page.query_selector("h1.main-heading")
assert element is not None
# Capture screenshot
page.screenshot(path="screenshot.png")
browser.close()
Approach B: Running Server (Reconnaissance-then-Action)
When a dev server is already running:
- Reconnaissance: Navigate to the app and discover the page structure
- Wait for stability:
page.wait_for_load_state('networkidle') - Inspect: Query elements, read content, check console logs
- Act: Interact with forms, buttons, navigation
- Verify: Assert expected outcomes
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
# Capture console messages
console_messages = []
page.on("console", lambda msg: console_messages.append(
f"[{msg.type}] {msg.text}"
))
# Navigate and wait for stability
page.goto("http://localhost:3000")
page.wait_for_load_state("networkidle")
# Discover page structure
headings = page.query_selector_all("h1, h2, h3")
buttons = page.query_selector_all("button")
forms = page.query_selector_all("form")
links = page.query_selector_all("a[href]")
# Print discovered elements
for h in headings:
print(f"Heading: {h.text_content()}")
for btn in buttons:
print(f"Button: {btn.text_content()}")
# Screenshot before interaction
page.screenshot(path="before-interaction.png")
# Interact with form
page.fill("input[name='email']", "[email protected]")
page.fill("input[name='password']", "testpass123")
page.click("button[type='submit']")
page.wait_for_load_state("networkidle")
# Screenshot after interaction
page.screenshot(path="after-interaction.png")
# Check for console errors
errors = [m for m in console_messages if "[error]" in m.lower()]
if errors:
print(f"Console errors found: {errors}")
browser.close()
Установить webapp-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteBashGlobGrepВложенные файлы
FAQ
Что делает скилл webapp-testing?
Test local web applications using Playwright with Python. Verify frontend functionality, debug UI behavior, capture screenshots, and view browser console logs. Supports static HTML files, dynamic webapps with running servers, and automated test generation.
Как установить скилл webapp-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл webapp-testing запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic