Module: Async::WebDriver::Installer::Chrome

Defined in:
lib/async/webdriver/installer/chrome.rb,
lib/async/webdriver/installer/chrome/platform.rb,
lib/async/webdriver/installer/chrome/releases.rb,
lib/async/webdriver/installer/chrome/installation.rb

Overview

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

Versions can be specified as:

  • A channel symbol: ‘:stable`, `:beta`, `:dev`, `:canary`

  • A major version string: ‘“148”` (resolves to the latest patch)

  • An exact version string: ‘“148.0.7778.56”`

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

## Example

“‘ ruby 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:

“‘ ruby bridge = Async::WebDriver::Bridge::Chrome.for(:stable) “`

Defined Under Namespace

Modules: Platform, Releases Classes: Installation

Class Method Summary collapse

Class Method Details

.find(version, cache_path: Installer.cache_path("chrome")) ⇒ Object

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



60
61
62
# File 'lib/async/webdriver/installer/chrome.rb', line 60

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

.install(version = :stable, cache_path: Installer.cache_path("chrome")) ⇒ Object

Ensure the given version is installed and return an Installation.

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



51
52
53
# File 'lib/async/webdriver/installer/chrome.rb', line 51

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