AI Agent Hub
Back to skills
💻

Web App Playwright Testing

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @org-02qudk26/webapp-testing-zh.

About this skill

Problem

Local web app testing is rarely blocked by missing frameworks; it is blocked by engineering details: starting one or more services, cleaning up ports and processes, finding selectors after dynamic rendering, and deciding when the DOM is safe to inspect. Reading large helper scripts into context or hand-writing server lifecycle for every task slows the session and increases errors.

How It Works

The skill separates concerns: scripts/with_server.py is treated as a black box for server startup and cleanup, while automation scripts only contain synchronous Playwright logic. Check --help before use, then start a single server or multiple services. Prefer sync_playwright(), descriptive selectors (text=, role=, CSS, ID), and explicit waits such as page.wait_for_selector(). Selector discovery follows a reconnaissance-then-action loop: inspect the rendered DOM, identify the node or role to target, then perform the action. For dynamic pages, wait for page.wait_for_load_state('networkidle') before checking the DOM; examples/ includes patterns for discovering buttons, links, and inputs, local HTML automation, and console logging.

Notes

Do not read scripts/ as documentation unless --help is insufficient; close the browser after tests. For login state, WebSocket updates, slow third-party APIs, or pages where networkidle never stabilizes, use more specific element waits, timeouts, or custom probes.

Use Cases

  • Start two servers, then test a button with Playwright
  • Wait for networkidle, then identify and click selector
  • Use example script to list buttons, links, inputs
  • Capture console logs while automating a local web app

Best For

  • Frontend engineers who start local stacks and verify interactions
  • QA engineers who need stable selectors on rendered pages
  • Full-stack developers writing Playwright regression tests
  • Tech leads who want helpers used as black-box scripts