Skip to content

Unify web drivers: merge CdpWebDriver into WebDriver#3104

Draft
amanjeetsingh150 wants to merge 3 commits intomainfrom
fix-web-driver
Draft

Unify web drivers: merge CdpWebDriver into WebDriver#3104
amanjeetsingh150 wants to merge 3 commits intomainfrom
fix-web-driver

Conversation

@amanjeetsingh150
Copy link
Copy Markdown
Collaborator

Summary

  • Merge CdpWebDriver (local/CLI) and WebDriver (cloud/Selenium-only) into a single WebDriver with CDP as the source of truth
  • Add SeleniumFactory + CdpClientFactory abstractions so cloud can inject Browserbase factories via Maestro.web()
  • Add missing features from old WebDriver: executeAsyncJS, Flutter-aware scroll/swipe, page-load wait
  • Cache Flutter detection once in open() instead of repeated JS calls per scroll/swipe
  • CdpClient now supports direct WebSocket mode for Browserbase (no HTTP target discovery)
  • Add demo_app_branch input to test-e2e.yaml workflow

Related

Test plan

  • ./gradlew test passes (all 118 tasks)
  • Run e2e workflow with demo_app_branch: web-test-flows to verify new flows
  • Cloud consumer update: WebDevice.kt adds BrowserbaseCdpClientFactory and calls Maestro.web()

🤖 Generated with Claude Code

amanjeetsingh150 and others added 3 commits April 1, 2026 02:32
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>
@amanjeetsingh150 amanjeetsingh150 marked this pull request as draft April 1, 2026 03:17
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.

1 participant