Async::WebDriverSourceAsyncWebDriverInstallerChrome

module Chrome

Installer for Chrome for Testing, the purpose-built Chrome variant designed for automated testing.

Versions can be specified as:

Installations are cached in ~/.cache/async-webdriver.rb/ by default (respects $XDG_CACHE_HOME).

Example

installation = Async::WebDriver::Installer::Chrome.install(:stable)
bridge = Async::WebDriver::Bridge::Chrome.new(
  driver_path:  installation.driver_path,
  browser_path: installation.browser_path,
)

Or via the convenience shorthand on the bridge:

bridge = Async::WebDriver::Bridge::Chrome.for(:stable)

Nested

Definitions

def self.install(version = :stable, cache_path: Installer.cache_path("chrome"))

Ensure the given version is installed and return an class Async::WebDriver::Installer::Chrome::Installation.

Checks the local cache first; downloads from the Chrome for Testing infrastructure only when the version is not already present.

Signature

parameter version Symbol | String

Version specifier.

parameter cache_path String

Root of the cache directory.

returns Installation

Implementation

def self.install(version = :stable, cache_path: Installer.cache_path("chrome"))
	Installation.install(version, cache_path: cache_path)
end

def self.find(version, cache_path: Installer.cache_path("chrome"))

Find an already-installed version or channel without hitting the network.

Signature

parameter version Symbol | String

Channel or exact version string.

parameter cache_path String

Root of the cache directory.

returns Installation | Nil

Implementation

def self.find(version, cache_path: Installer.cache_path("chrome"))
	Installation.find(version, Platform.current, cache_path: cache_path)
end