playwright-interactive

Debug web and Electron apps through a persistent Playwright session in js_repl.

1|Updated May 8, 2026
One-click install
npx skills add https://github.com/dicarsmtz/product-engineering-kit --skill playwright-interactive-dicarsmtz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-interactive
Source: https://github.com/dicarsmtz/product-engineering-kit/tree/main/plugins/product-engineering/skills/playwright-interactive
Command: npx skills add https://github.com/dicarsmtz/product-engineering-kit --skill playwright-interactive-dicarsmtz

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Iterative UI debugging usually requires relaunching browsers and losing state between every code change. This Skill keeps a single Playwright session alive inside js_repl so you can reload pages, rerun functional and visual QA, and capture screenshots without restarting the toolchain. ## Core Features & Use Cases - Persistent Browser Sessions: Reuse the same Playwright handles (browser, context, page, Electron app) across iterations, reloading only what changed. - Web and Electron Support: Launch headed Chromium with explicit or native viewports, emulate mobile contexts, or launch Electron apps directly through Playwright. - Structured QA Workflow: Build a shared QA inventory, run functional checks with real user input, perform a separate visual QA pass, and verify viewport fit before signoff. - CSS-Normalized Screenshots: Emit model-ready screenshots with correct CSS pixel coordinates for both web pages and Electron windows. - Use Case: While fixing a layout bug in a local React app, keep the dev server and browser alive, reload after each edit, click through every control, and capture viewport screenshots proving the fix. ## Quick Start Use playwright-interactive to launch my local app at http://127.0.0.1:3000 in a persistent Playwright session and run functional and visual QA on it.

Frequently Asked Questions about playwright-interactive

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

FAQPage Schema
How do I debug a web app with Playwright without restarting the browser?

Keep a persistent Playwright session in js_repl by storing browser, context, and page handles as top-level var bindings. After each code change, reload the existing page for renderer changes instead of relaunching the browser.

How do I test an Electron app with Playwright?

Launch the app with Playwright's _electron.launch API, passing the app entry point such as "." or "./main.js". Grab the first window with electronApp.firstWindow() and reuse it, relaunching only after main-process or preload changes.

Why does Playwright fail with Cannot find module 'playwright'?

The playwright package is not installed in the current workspace. Run npm install playwright from the project directory, then verify with a Node import check before using js_repl, and run npx playwright install chromium if the browser binary is missing.

Can I emulate mobile devices with Playwright?

Yes, create a separate browser context with a mobile viewport such as 390x844, plus isMobile and hasTouch set to true. This mobile context shares the same browser instance as your desktop context.

Why do Playwright screenshots have wrong coordinates on Retina displays?

In native-window mode, Chromium and Electron can return device-pixel screenshots even when CSS scale is requested. Normalize captures to CSS pixels using canvas resizing for web or BrowserWindow.capturePage with nativeImage.resize for Electron.