module Chrome
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
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
versionSymbol | String Version specifier.
-
parameter
cache_pathString 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
versionSymbol | String Channel or exact version string.
-
parameter
cache_pathString 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