Playwright interactive

From SteelMorgan/1c-agent-based-dev-framework · View interactive version

Playwright interactive is an AI agent skill from the GitHub repository SteelMorgan/1c-agent-based-dev-framework. Интерактивная Playwright-отладка в постоянной сессии

How to use this skill

Skill file

Playwright Interactive Skill

Persistent js_repl Playwright session for iterative UI debugging of web and Electron apps. Keep the same handles alive across iterations.

1C Boundary

For 1C:Enterprise UI, interactive Playwright is not the preferred path for ordinary forms. First use va-visual-check: Vanessa Automation/TestClient and VA MCP for opening forms, clicking commands, filling fields, checking table rows, validating client-side behavior, and taking UI/UX screenshots. Use interactive Playwright for 1C only when the target is browser-specific or as fallback under va-visual-check: DOM/CSS/HTML, browser console/network, cookies/storage, web publication/auth, web-client viewport/pixel rendering, Chrome/Edge-only behavior, browser extension behavior, or browser-only file/clipboard flows. If used for 1C, record the VA steps already attempted, why browser evidence is sufficient, and the residual risk.

Preconditions

One-time setup

test -f package.json || npm init -y
npm install playwright
node -e "import('playwright').then(() => console.log('playwright import ok')).catch((error) => { console.error(error); process.exit(1); })"

For web: npx playwright install chromium. For Electron: npm install --save-dev electron.

Core Workflow

  1. Build QA inventory from: user requirements, implemented features, claims for final response.
  2. Run bootstrap cell once (see references/snippets.md > Bootstrap).
  3. Start or confirm dev server in persistent TTY.
  4. Launch runtime, keep reusing Playwright handles.
  5. After code change: reload (renderer-only) or relaunch (main-process/startup).
  6. Run functional QA.
  7. Run separate visual QA pass.
  8. Verify viewport fit, capture signoff screenshots.
  9. Clean up only when task is finished.

Session Modes

All code snippets for session setup are in references/snippets.md.

| Mode | When | Key parameters | Snippet |

|------|------|---------------|---------|

| Desktop web | Default iteration | viewport: { width: 1600, height: 900 } | snippets.md > Desktop Web Context |

| Mobile web | Mobile testing | viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true | snippets.md > Mobile Web Context |

| Native-window web | OS-level DPI, browser chrome validation | viewport: null | snippets.md > Native-Window Web Pass |

| Electron | Desktop app | electronLauncher.launch({ args: [ELECTRON_ENTRY] }) | snippets.md > Electron Session |

Binding rules:

Reload vs Relaunch

| Change type | Action |

|-------------|--------|

| Renderer-only | await reloadWebContexts() or await appWindow.reload(...) |

| Main-process, preload, startup | Relaunch Electron (snippets.md > Electron Restart) |

| Uncertain process ownership | Relaunch |

Screenshots

Default: CSS-normalized, JPEG quality 85. All helpers in references/snippets.md > Screenshot Helpers.

| Surface | Default path | Fallback (native-window) |

|---------|-------------|--------------------------|

| Web page | await emitWebJpeg(page) | emitWebScreenshotCssScaled({ page }) |

| Mobile web | await emitWebJpeg(mobilePage) | same with mobilePage |

| Electron | emitElectronScreenshotCssScaled({ electronApp }) | (always main-process path) |

| Raw (fidelity-sensitive only) | surface.screenshot({ type: "jpeg", quality: 85 }) | |

Key rules:

Viewport Fit Checks (Required)

Before signoff, verify the intended initial view. Snippet in references/snippets.md > Viewport Fit Check.

Dev Server

Keep the app running in a persistent TTY session. Verify port is listening before page.goto(...). For Electron with a separate dev server (Vite/Next), keep that running first.

Cleanup

Run cleanup cell from references/snippets.md > Cleanup when finished. Exiting Codex does not implicitly run browser.close() or electronApp.close().

Checklists

Session Loop

Functional QA

Visual QA

Signoff

Common Failure Modes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.