Skip to content

Unify Selenium and Playwright browser management - #723

Merged
sazid merged 4 commits into
devfrom
shared-cft
Jul 29, 2026
Merged

Unify Selenium and Playwright browser management#723
sazid merged 4 commits into
devfrom
shared-cft

Conversation

@nasif-z

@nasif-z nasif-z commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Issues

  • Selenium and Playwright downloaded and launched different Chrome binaries.
  • A browser opened by one action type was not always reused by the other action type.
  • Playwright Chrome launches did not support the same arguments, extensions, preferences, capabilities, and browser settings as Selenium launches.

Changes

  • Chrome and Chromium Playwright actions now use the same Chrome-for-Testing browser and matching ChromeDriver cache as Selenium actions.
  • Exact Chrome versions and the Stable, Beta, Dev, and Canary channels are resolved in one shared place.
  • Selenium and Playwright actions reuse the same named or default browser session when possible.
  • Playwright Chrome launches now support Selenium-style arguments, custom and encoded extensions, preferences, capabilities, mobile emulation, page-load strategy, and debugger attachment.
  • The Zeuz AI extensions and the shared Chromium launch arguments are applied consistently.
  • Firefox and WebKit/Safari use Playwright's managed browser installer and persistent cache.
  • Edge support is restored through Playwright's Microsoft Edge channel.
  • Regression tests cover shared binaries, session reuse, extensions, Selenium-compatible launch fields, debugger attachment, and non-Chrome browser routing.

Validation

  • 52 browser-session, Playwright parity, and locator tests pass.
  • Selenium and Playwright browser modules compile successfully.
  • The branch diff passes whitespace checks.

nasif-z added 3 commits July 29, 2026 17:36
- resolve Playwright Chrome launches through the shared Chrome-for-Testing browser and driver cache
- centralize exact-version and Stable/Beta/Dev/Canary normalization with per-channel cache metadata
- restrict Playwright browser creation to supported Chrome/Chromium variants and reject system Chrome
- reuse named Selenium and Playwright sessions before resolving or launching another browser
- persist the paired ChromeDriver path for exact Selenium CDP attachment
- share Chromium defaults and Zeuz AI extension arguments across both launchers
- use a temporary persistent Playwright context when extensions are enabled
- remove the standalone Playwright browser installer and download cache path
- add mocked regression coverage for shared binaries, extension loading, session reuse, and driver attachment
- parse Selenium-compatible add argument, add extension, and add encoded extension fields for Chromium launches
- cache and unpack CRX, ZIP, extension-ID downloads, and encoded extension payloads for persistent Playwright contexts
- support experimental options, Chrome preferences, excluded switches, and mobile emulation
- map shared capabilities for insecure certificates, proxy settings, Chrome options, and page-load strategy
- support debugger-address CDP attachment without resolving or launching Chrome-for-Testing
- preserve Selenium element waits and navigation strategy across Playwright sessions
- create and safely clean temporary Chrome preference profiles
- correct CRX2 and CRX3 header extraction and handle failed extension downloads
- add regression coverage for launch-field compatibility, extension unpacking, profile preferences, session behavior, and debugger attachment
- accept Firefox/FirefoxHeadless, WebKit/Safari, and Edge browser aliases in Playwright actions
- restore Playwright-managed Firefox and WebKit installation in the persistent Zeuz browser cache
- retain the Playwright system-channel launch path for Microsoft Edge
- keep Chrome, Chromium, ChromeHeadless, and Chrome channels on the shared Chrome-for-Testing browser and driver installer
- isolate Chromium-only arguments, extensions, preferences, and debugger attachment from Firefox and WebKit launches
- mark non-CFT sessions as unsupported for lazy Selenium CDP attachment
- run browser installation outside the async event loop and reuse cached binaries under an install lock
- add mocked regression coverage for Firefox, WebKit, Safari, and Edge launch routing
@nasif-z nasif-z self-assigned this Jul 29, 2026
- accept Selenium-style Chrome, Chromium, Edge, Firefox, and Safari option rows for the active Playwright browser
- map Firefox arguments and preferences from firefox option and moz:firefoxOptions fields
- map Edge arguments, preferences, extensions, and ms:edgeOptions fields through persistent Microsoft Edge contexts
- pass Safari option arguments to WebKit launches
- support Chromium localState profiles and browserVersion capabilities
- map WebDriver implicit and page-load timeouts to Playwright context timeouts
- handle accept, dismiss, notify variants, and ignore values for unhandled prompts
- apply shared Chromium defaults and Zeuz extension arguments to Edge launches
- add regression coverage for browser-specific options, vendor capabilities, extensions, preferences, timeouts, prompts, and local state
@nasif-z
nasif-z marked this pull request as ready for review July 29, 2026 13:14
@nasif-z
nasif-z requested a review from Muntasib-creator July 29, 2026 13:15
@sazid
sazid merged commit f77b0bb into dev Jul 29, 2026
7 checks passed
@sazid
sazid deleted the shared-cft branch July 29, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants