Unify web drivers: merge CdpWebDriver into WebDriver#3104
Draft
amanjeetsingh150 wants to merge 3 commits intomainfrom
Draft
Unify web drivers: merge CdpWebDriver into WebDriver#3104amanjeetsingh150 wants to merge 3 commits intomainfrom
amanjeetsingh150 wants to merge 3 commits intomainfrom
Conversation
The clearState command was only implemented in CdpWebDriver (used locally) but not in WebDriver (used on Cloud via Browserbase). This caused clearState to silently no-op on Cloud, leaving cookies, localStorage, and sessionStorage intact. Clears localStorage, sessionStorage, cookies, and IndexedDB via JavaScript execution through the existing Selenium driver. Fixes tests using clearState on Maestro Cloud web platform.
Delete CdpWebDriver and the old Selenium-only WebDriver, replacing both with a single WebDriver that uses CDP for JS eval, screenshots, navigation, and clearState, plus Selenium for interactions. Key changes: - WebDriver accepts SeleniumFactory + CdpClientFactory (defaults to local Chrome) - Add executeAsyncJS and Flutter-aware scroll/swipe from old WebDriver - Cache isFlutterApp detection in open() instead of per-call JS checks - Add page-load wait (document.readyState) after CDP navigation - CdpClient supports direct WebSocket mode for Browserbase - Maestro.web() accepts optional factory params for cloud consumers - Update DeviceService.kt to use new WebDriver - Add demo_app_branch input to test-e2e.yaml workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
CdpWebDriver(local/CLI) andWebDriver(cloud/Selenium-only) into a singleWebDriverwith CDP as the source of truthSeleniumFactory+CdpClientFactoryabstractions so cloud can inject Browserbase factories viaMaestro.web()executeAsyncJS, Flutter-aware scroll/swipe, page-load waitopen()instead of repeated JS calls per scroll/swipeCdpClientnow supports direct WebSocket mode for Browserbase (no HTTP target discovery)demo_app_branchinput totest-e2e.yamlworkflowRelated
clearStatedivergence from PR Add web support for clearState #2996Test plan
./gradlew testpasses (all 118 tasks)demo_app_branch: web-test-flowsto verify new flowsWebDevice.ktaddsBrowserbaseCdpClientFactoryand callsMaestro.web()🤖 Generated with Claude Code