playwright-skill

Automates browser testing and web interactions using Playwright scripts executed via a universal Node.js runner.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Peterson-Benhame/agent-skills --skill playwright-skill-peterson-benhame
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-skill
Source: https://github.com/Peterson-Benhame/agent-skills/tree/main/packages/skills-catalog/skills/%28web-automation%29/playwright-skill
Command: npx skills add https://github.com/Peterson-Benhame/agent-skills --skill playwright-skill-peterson-benhame

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright.

What problem does it solve? Manually testing websites, filling forms, checking responsive layouts, and validating login flows is repetitive and error-prone. This Skill writes and executes custom Playwright automation code for any browser task, with automatic dev server detection and visible browser execution for debugging. ## Core Features & Use Cases - Custom Browser Automation: Writes tailored Playwright scripts to /tmp for any task—page testing, form filling, screenshots, link checking, and responsive design validation across desktop, tablet, and mobile viewports. - Auto-Detection of Dev Servers: Scans common localhost ports (3000, 3001, 5173, 8080, etc.) to find running dev servers before writing test code, eliminating hardcoded URLs. - Universal Executor: Runs automation from files, inline code, or stdin via run.js with automatic Playwright installation, error handling, and module resolution. - Use Case: Ask to test whether your login flow redirects correctly—the Skill detects your dev server on port 3001, writes a login automation script using environment-variable credentials, executes it in a visible browser, and reports the result. ## Quick Start Ask the agent to test your local web app, for example: "Test if my marketing page looks good on mobile and desktop and take screenshots."

Frequently Asked Questions about playwright-skill

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

FAQPage Schema
How do I automate browser testing with Playwright?

Describe the task you want automated, and a custom Playwright script is written to /tmp and executed via the run.js wrapper. The script launches a visible Chromium browser by default, navigates to your target URL, and performs actions like clicking, form filling, and screenshots.

How to test a localhost dev server with Playwright?

Run the detectDevServers helper first, which scans common ports like 3000, 3001, 5173, and 8080 for running servers. The detected URL is then parameterized as a TARGET_URL constant at the top of the generated test script.

Does Playwright support testing responsive design on mobile viewports?

Yes, Playwright supports viewport resizing via page.setViewportSize and full device emulation using the devices descriptor, such as iPhone 12. You can loop through desktop, tablet, and mobile viewport sizes and capture screenshots for each.

Can I pass custom HTTP headers to all Playwright requests?

Yes, set the PW_HEADER_NAME and PW_HEADER_VALUE environment variables for a single header, or PW_EXTRA_HEADERS as a JSON object for multiple headers. Headers are merged automatically when creating contexts through the helpers.createContext function.

Why does my Playwright script fail with module not found errors?

Module resolution fails when scripts run outside the skill directory where Playwright is installed. Always execute scripts through the run.js wrapper from the skill directory, and run npm run setup first if Playwright is not yet installed.

When should I not use this browser automation approach?

Avoid it for quick page debugging or network inspection, where browser DevTools are more appropriate. It is designed for full automation tasks like testing flows and capturing screenshots, not lightweight inspection of a single page.