Add full implementation of `browser screenshot <path>` (§10.2) including:
- Core viewport screenshot via CDP Page.captureScreenshot
- --full flag for full-page capture using Page.getLayoutMetrics
- --selector flag to clip to a specific CSS element region
- --screenshot-format (png/jpeg) with extension inference
- --screenshot-quality for JPEG compression control
- --annotate flag that overlays numbered labels on interactive elements
and returns annotations metadata (ref, number, role, name, box)
Expand RefCache to store role/name (RefEntry) so annotate can build
complete annotation metadata without re-fetching the AX tree.
Includes 11 unit tests and 12 E2E tests covering happy paths
(json/text/jpeg/full/selector/annotate) and error paths
(invalid path, session/tab not found, missing args).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add browser click interaction tests
* Expand browser click interaction coverage
* [packages/cli-v2]feat: implement browser click command with shared element resolution
Add full browser click implementation with CDP mouse event dispatch,
selector/coordinate parsing, --button/--count/--new-tab flags, navigation
detection, and XPath support. Extract element resolution into a shared
browser::element utility for reuse by future interaction commands.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [packages/cli-v2]fix: use shared resolver for --new-tab href check and add click to help
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add browser type interaction tests
* [packages/cli-v2]feat: implement browser type command
Keystroke-by-keystroke text input via CDP Input.dispatchKeyEvent.
Resolves element through shared element utility, focuses and positions
cursor at end before typing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [packages/cli-v2]fix: populate context URL/title and use char count in browser type
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add browser fill interaction tests
* [packages/cli-v2]feat: implement browser fill command
Direct value setting via native input setter with synthetic input event
dispatch. No keystroke simulation — replaces existing value entirely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [packages/cli-v2]fix: pick native value setter based on element type in browser fill
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add textarea fill regression test
* Add browser select interaction tests
* [packages/cli-v2]feat: implement browser select command
Select dropdown options by value or visible text (--by-text flag).
Dispatches input and change events after selection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [packages/cli-v2]fix: use resolved node for select instead of re-querying with querySelector
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Format interaction files for lint
* [packages/cli-v2]fix: scroll into view before click and replace fixed navigation delay
Scroll elements into the viewport via DOM.scrollIntoViewIfNeeded before
computing bounding-box coordinates, so clicks on off-screen elements
land correctly. Replace the hardcoded 500ms post-click sleep with a
polling loop that detects URL changes at 50ms intervals (2s timeout),
avoiding unnecessary delays for non-navigating clicks and catching
slow SPA transitions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implement the three observation commands using CDP Runtime.evaluate:
- browser.title: document.title → data.value (string)
- browser.url: document.URL → data.value (string)
- browser.viewport: window.innerWidth/innerHeight → data.width + data.height (numbers)
All three use __ctx_url sideband so context.url is populated per §2.5.
context() updated from stub (url: None) to extract __ctx_url from data.
Also resolve merge conflicts with release/1.0.0:
- observation/mod.rs: include both snapshot_transform and title/url/viewport
- tests/e2e/main.rs: include both snapshot and page_info test modules
- output.rs: include both browser.snapshot and browser.title/url/viewport cases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 tests covering:
- JSON envelope: ok/command/context/data/error/meta (§2.4)
- data fields: format="snapshot", content with [ref=eN] labels,
nodes with ref/role/name, stats with node_count/interactive_count
- Text output: [sid tid] url prefix + content directly (§2.5)
- Optional flags: --interactive, --compact, --depth, --selector
- Error paths: SESSION_NOT_FOUND (context=null), TAB_NOT_FOUND,
missing --session/--tab args
- context.url + context.title present on success
- meta.truncated boolean
Current stub implementation will fail happy-path tests.
Error-path tests may pass since they run before snapshot logic.
--cursor flag test left as TODO pending implementation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds strict api-reference.md §9 contract tests for all 4 navigation
commands. Tests cover JSON envelope (§2.4), data fields, text output
format (§2.5), context.url/title post-navigation update (§5.6), and
error paths (SESSION_NOT_FOUND, TAB_NOT_FOUND).
goto tests expected to pass (command is implemented).
back/forward/reload tests expected to fail until implementation lands.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
search and get commands were removed from CLI. The api_commands.rs
test file was still calling them, causing E2E CI failure.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>