AgentSkillsCN

webapp-testing

利用 Playwright 与本地 Web 应用程序进行交互与测试的工具集。支持验证前端功能、调试 UI 行为、截取浏览器屏幕截图,以及查看浏览器日志。

SKILL.md
--- frontmatter
name: webapp-testing
description: Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

Web Application Testing

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

Core Capabilities

  • Browser Automation: Interact with web elements (clicks, typing, navigation).
  • Verification: Assert page states, content, and behavior.
  • Diagnostics: Capture screenshots, view console logs, and network history.
  • Server Management: Automated startup/shutdown of local dev servers.

Reconnaissance-Then-Action Pattern

  1. Navigate and Wait: Go to the URL and wait for networkidle.
  2. Inspect: Take screenshot or inspect DOM to identify selectors.
  3. Execute: Perform actions using discovered selectors.

Best Practices

  • Always use networkidle state before interacting with dynamic apps.
  • Use headless mode for CI/automation.
  • Prefer descriptive selectors (role, text) over brittle CSS paths.
  • Clean up browser instances after testing.