webapp-testing

Automate browser testing of local web applications using Python Playwright scripts.

Updated Sep 1, 2021
One-click install
npx skills add https://github.com/WP-Coaching/pellegrims.coach --skill webapp-testing-wp-coaching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webapp-testing
Source: https://github.com/WP-Coaching/pellegrims.coach/tree/main/.agents/skills/webapp-testing
Command: npx skills add https://github.com/WP-Coaching/pellegrims.coach --skill webapp-testing-wp-coaching

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright, and includes scripts (resource) components.

What problem does it solve? Testing local web applications manually is slow and error-prone, especially when verifying frontend behavior, debugging UI issues, or capturing browser state. This Skill provides a structured Playwright-based workflow for automating browser interactions against local development servers. ## Core Features & Use Cases - Server Lifecycle Management: The with_server.py helper starts one or more servers, waits for readiness, runs your automation, and cleans up afterward. - Reconnaissance-Then-Action Pattern: Inspect the rendered DOM after networkidle, identify selectors, then execute actions against dynamic web apps. - Example Scripts: Ready-made patterns for element discovery, static HTML automation via file:// URLs, and console log capture. - Use Case: You need to verify a contact form on a Next.js dev server. Use with_server.py to launch the server, then run a Playwright script that fills the form, submits it, and screenshots the result. ## Quick Start Ask the AI to test your local web app by starting the dev server with the with_server.py helper and writing a Playwright script that navigates to the page, waits for networkidle, and captures a screenshot.

Frequently Asked Questions about webapp-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a local web application with Playwright in Python?

Write a Python script using sync_playwright, launch Chromium in headless mode, navigate to your local server URL, and wait for the networkidle load state before interacting with elements. Use the with_server.py helper to start and stop the dev server automatically around your script.

How do I run Playwright tests against a server that is not yet started?

Use the with_server.py helper script, passing your server command and port, followed by the automation command. It starts the server, polls the port until ready, runs your script, and terminates the server afterward. It also supports multiple servers such as a backend plus frontend.

Why does my Playwright script fail to find elements on a dynamic web app?

The script likely inspects the DOM before JavaScript finishes rendering. Always call page.wait_for_load_state('networkidle') after navigation before querying selectors or taking screenshots on dynamic applications.

Can Playwright automate static HTML files without a server?

Yes, Playwright can open local HTML files directly using file:// URLs built from the absolute file path. The static_html_automation.py example shows navigation, form filling, clicking, and screenshot capture without any running server.

How do I capture browser console logs during Playwright automation?

Register a handler with page.on('console', handler) before navigating, and append each message to a list. The console_logging.py example demonstrates capturing logs during interactions and saving them to a file after the browser closes.