Async::WebDriverSourceAsyncWebDriverInstallerChromeReleases

module Releases

Resolves Chrome for Testing version specifiers and download URLs using the public Chrome for Testing JSON API.

Definitions

CHANNELS_URL = "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json"

Returns the latest known-good version for each release channel.

VERSIONS_URL = "https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json"

Returns every known-good version with its download URLs.

CHANNELS

Maps symbolic channel names to the API's title-case keys.

Implementation

CHANNELS = {
	stable: "Stable",
	beta:   "Beta",
	dev:    "Dev",
	canary: "Canary",
}.freeze

def self.resolve(version, platform)

Resolve a version specifier and platform to a version string and download URLs.

Signature

parameter version Symbol | String

:stable, :beta, :dev, :canary, a major version string like "148", or an exact version like "148.0.7778.56".

parameter platform String

A Chrome for Testing platform string, e.g. "mac-arm64".

returns Hash

{ version:, chrome_url:, chromedriver_url: }

Implementation

def self.resolve(version, platform)
	case version
	when Symbol                    then resolve_channel(version, platform)
	when /\A(stable|beta|dev|canary)\z/ then resolve_channel(version.to_sym, platform)
	when /\A\d+\z/                 then resolve_major(version, platform)
	else                                resolve_exact(version, platform)
	end
end