test-electron-app

Drive the running PostHog Electron app over CDP to test and verify desktop changes.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill test-electron-app
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-electron-app
Source: https://github.com/PostHog/posthog-foss/tree/main/products/desktop/.claude/skills/test-electron-app
Command: npx skills add https://github.com/PostHog/posthog-foss --skill test-electron-app

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires agent-browser, and includes references (resource) components.

What problem does it solve?

Verifying changes in a real Electron desktop app normally requires manual clicking and screenshotting. This Skill lets an agent connect to the live PostHog Electron app over the Chrome DevTools Protocol, interact with real UI state, and verify changes against live tRPC and backend data without manual effort.

Core Features & Use Cases

  • CDP-driven interaction: Connect to the running app on port 9222 with agent-browser, snapshot the accessibility tree, click elements, and inspect network requests.
  • Live backend-to-desktop E2E testing: Run the app against a local Django stack with real OAuth login, seeded projects, and ClickHouse fixtures, guided by the included reference document.
  • Safe lifecycle management: Launch the dev app headlessly, avoid killing user-owned instances, and use an idle watchdog to clean up forgotten sessions.
  • Use Case: After changing a desktop UI component, connect to the running dev app, navigate to the affected view, snapshot the accessibility tree, and confirm the new element renders with live data.

Quick Start

Ask the agent to connect to the running PostHog desktop app on port 9222 and verify that your recent UI change appears correctly in the live window.

Frequently Asked Questions about test-electron-app

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

FAQPage Schema
How do I test an Electron app over the Chrome DevTools Protocol?

Launch the Electron app with remote debugging enabled, then connect with agent-browser using agent-browser connect 9222. From there you can snapshot the accessibility tree, click elements by ref or testid, and inspect network requests.

How do I verify a UI change in the PostHog desktop app?

Run pnpm app:cdp to preflight and connect to the dev app on port 9222, then use agent-browser snapshot to read the accessibility tree. Re-snapshot after each interaction to confirm the change rendered with live data.

Should I use agent-browser or Playwright for Electron testing?

Use agent-browser over CDP for ad-hoc verification, dogfooding, and screenshots of the real running app with live data. Use the Playwright E2E suite in apps/code/tests/e2e for regression coverage in CI.

Why is the CDP connection on port 9222 refused?

Connection refused means the app is not running with remote debugging enabled. Start it with pnpm dev:code in the background, then poll curl localhost:9222/json/version until it responds before connecting.

Can I run the PostHog dev Electron app headlessly without a terminal?

Yes, but not with pnpm dev, whose phrocs TUI requires a TTY. Run pnpm build:deps first, then launch pnpm dev:code in the background; electron-vite dev stays up without stdin and opens the CDP port itself.