playwright-skill

Automates browser testing and web interaction tasks using custom Playwright scripts.

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill playwright-skill-duccuong159
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-skill
Source: https://github.com/DucCuong159/Realtime-chatapp/tree/main/.agent/skills/playwright-skill
Command: npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill playwright-skill-duccuong159

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright, sanitize-filename.

What problem does it solve? Manually testing web pages across browsers, viewports, and user flows is repetitive and error-prone. This Skill writes and executes custom Playwright automation code on demand, with automatic dev server detection so you never hardcode localhost URLs. ## Core Features & Use Cases - Custom Browser Automation: Generates and runs Playwright scripts for any task—page testing, form filling, login flows, link checking, and screenshots—via a universal executor (run.js). - Auto Dev Server Detection: Scans common ports (3000, 3001, 5173, 8080, etc.) to find running local servers before writing test code. - Reusable Helpers & Custom Headers: Provides utility functions for safe clicks, retries, cookie banners, and table extraction, plus environment-variable-based HTTP header injection for identifying automated traffic. - Use Case: Ask to verify a login flow on your local app—the Skill detects the dev server on port 3001, writes a test script to /tmp, runs it in a visible browser, and confirms the redirect to the dashboard. ## Quick Start Ask the assistant to test whether the login page on your local dev server redirects correctly after submitting valid credentials.

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 reports results in real time.

How to test a localhost app without hardcoding the URL?

Use the detectDevServers helper, which scans common ports like 3000, 3001, 5173, and 8080 for running servers. Detected URLs are placed in a TARGET_URL constant at the top of each generated script.

Does Playwright support headless and headed browser modes?

Yes, Playwright supports both modes via the headless launch option. This Skill defaults to headless: false so you can watch the automation, and only uses headless mode when you explicitly request background execution.

Can I add custom HTTP headers to Playwright requests?

Yes, set 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 Playwright fail with module not found errors?

Module resolution fails when scripts run outside the skill directory. Always execute through the run.js wrapper from the skill directory, and run npm run setup first to install Playwright and the Chromium browser.