feat(ruby): M1–M2 — core interactions + full outbound surface (76/77) - #2854
Draft
filip-michalsky wants to merge 3 commits into
Conversation
Milestone 1 toward v4 parity for the Ruby SDK (release bar per PM: parity with the other v4 languages): - Locator (new): click/fill/type/count/text_content/inner_text/ input_value/visible?/checked?/set_input_files, with first/nth chaining; created via page.locator(selector). - FileUpload (new): path/FilePayload normalization, 50 MiB limit, base64 wire payloads — port of file_upload.py. - Page: click/hover/scroll/type/key_press, evaluate, screenshot (base64 decode + optional path write, mask via locators), reload/go_back/go_forward, wait_for_load_state/selector/timeout, locator factory. - Tests: shared FakeTransport extracted to test/support, new locator/page/file-upload suites (61 runs, 484 assertions). - Examples: file_upload.rb (mirrors Python) and page_interactions.rb — both LLM-free, verified live on local Chrome AND Browserbase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…low) Two workflow examples exercising the milestone-1 surface end to end: hybrid_news.rb (Hacker News: locator counts, schema extract of top stories, locator-click pagination, screenshot) and search_flow.rb (DuckDuckGo: locator fill + Enter, wait_for_selector, schema extract of results). Both verified live on Browserbase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Milestone 2 of the parity roadmap: every outbound protocol method is now wrapped; only inbound llm.generate (client-side LLM) remains. - Response: navigation methods return Stagehand::Response (all_headers, headers_array, security_details, server_addr, body/text/json, finished) - Page: drag_and_drop, add_init_script, set_extra_http_headers, set_viewport_size, snapshot, close, page.on/off console events (CDPSubscription over page.cdp_event notifications), WebMCP tools - Locator: hover, scroll_to, inner_html, centroid, highlight, send_click_event, select_option (all 17 locator methods) - Context: close, init scripts, headers, domain policy, cookies (add/read/clear with Regexp filters), clipboard (6 methods) - stagehand.callback_batch: CDP delivery expression (identical to the sibling SDKs) + Client#experimental_batch - Examples: batch.rb, page_events.rb (canonical ports), and context_and_response.rb — all live-verified on local Chrome and Browserbase (page_events includes Gateway-backed extract) - Tests: 97 runs / 677 assertions Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
This was referenced Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the AP-2857 parity stack (stacked on the spike PR #2820):
Stack: #2820 (spike) ← this PR (M1–M2) ← M3 ← M4 (#2851)
M1 — core interactions
Locator(click/fill/type/readers/set_input_files +first/nth),FilePayloaduploads (50 MiB cap)page_interactions.rb,file_upload.rb,hybrid_news.rb,search_flow.rbM2 — complete outbound surface (76 of 77 methods)
Stagehand::Responsefor navigations (status/headers/body/security_details/finished)page.on("console") { … }→CDPSubscriptionoverpage.cdp_event, idempotentunsubscribestagehand.callback_batchCDP delivery (callback source travels as live code, expression identical to Python/TS) exposed asClient#experimental_batchbatch.rb,page_events.rb,context_and_response.rbVerification
The one method not in this PR — inbound
llm.generate— lands in the M3 PR above this one.🤖 Generated with Claude Code