Skip to content

feat(testing): Drive the real app with agent-browser#2660

Merged
charlesvien merged 13 commits into
mainfrom
feat/agent-browser-electron-testing
Jun 13, 2026
Merged

feat(testing): Drive the real app with agent-browser#2660
charlesvien merged 13 commits into
mainfrom
feat/agent-browser-electron-testing

Conversation

@charlesvien

@charlesvien charlesvien commented Jun 13, 2026

Copy link
Copy Markdown
Member

Problem

We want to verify and screenshot changes in the real running Electron app (live tRPC, workspace-server, real data), not just in unit or E2E specs.

Changes

  1. Drive the real running app over CDP with agent-browser on :9222: snapshot the accessibility tree, click/type, and screenshot the live UI
  2. Add a test-electron-app skill documenting the connect → snapshot → screenshot loop plus repo specifics (port, auth/data, dev-alongside-prod)
  3. Add a pnpm app:cdp preflight (scripts/electron-cdp.mjs): validate the port, verify the app is reachable, then connect
  4. Launch the dev app with --remote-debugging-port=9222
  5. Drop --color-scheme dark: that global flag forces a 1280x720 viewport that blanks the Electron window and sticks in the agent-browser daemon until it restarts

How did you test this?

Manually by using itself

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 01ba6e2.

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
.claude/skills/screenshot-dev-app/SKILL.md:3
**`allowed-tools` pattern doesn't match `pnpm app:cdp`**

The pattern `Bash(pnpm app:cdp:*)` requires the command to begin with the literal string `pnpm app:cdp:` (colon-then-wildcard), so it covers subcommands like `pnpm app:cdp:something` but not the bare `pnpm app:cdp` invocation shown throughout the skill body. An agent following this skill will be blocked from running the preflight step. The same pattern also appears in `test-electron-app/SKILL.md`. Dropping the trailing colon — `Bash(pnpm app:cdp*)` — matches the bare command and any future variants.

### Issue 2 of 2
scripts/electron-cdp.mjs:25-30
**Spawn error other than ENOENT silently falls through**

The ENOENT guard only fires when the `agent-browser` binary can't be found. Any other `spawnSync` error (e.g. permission denied, `EACCES`) leaves `version.error` set but non-null with a different `.code`, so the check passes and execution continues to `version.stdout.trim()`. With `encoding: "utf8"` set, `stdout` will be an empty string rather than null, so it won't crash — but the success banner will read `✓ agent-browser ` with no version, and the script will proceed to the CDP check against an unusable binary. Consider broadening the guard to `version.error` (any error) to give a clear failure message.

Reviews (1): Last reviewed commit: "restore screenshot skill via agent-brows..." | Re-trigger Greptile

Comment thread .claude/skills/screenshot-dev-app/SKILL.md Outdated
Comment thread scripts/electron-cdp.mjs Outdated
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jun 13, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates denied this PR: it touches dependency/toolchain files (package.json changes) and exceeds the size threshold for auto-review. This needs a human reviewer.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jun 13, 2026
@charlesvien charlesvien force-pushed the feat/agent-browser-electron-testing branch from 759b017 to 195e1c5 Compare June 13, 2026 16:54
@charlesvien charlesvien changed the title feat(testing): Drive and screenshot the real app with agent-browser feat(testing): Drive the real app with agent-browser Jun 13, 2026
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jun 13, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates denied this PR: it touches dependency/toolchain files (package.json changes) and is classified as a cross-cutting feature too large for auto-approval. This requires a human reviewer.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jun 13, 2026
@charlesvien charlesvien enabled auto-merge (squash) June 13, 2026 22:18
@charlesvien charlesvien merged commit b231abd into main Jun 13, 2026
23 checks passed
@charlesvien charlesvien deleted the feat/agent-browser-electron-testing branch June 13, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants