Expand description
§Chrome for Testing API Client
This crate provides programmatic access to “chrome-for-testing” JSON APIs,
which are used to retrieve version details and other relevant information about
Chrome and ChromeDriver for testing purposes.
§Modules Overview
chromedriver:ChromeDriverspecific utilities, such as log level configuration.
§API Endpoints
The crate leverages the following JSON API endpoints:
-
Last Known Good Versions: Recent good versions for each release channel (Stable/Beta/Dev/Canary). Perfect if you just need the “latest stable” version for example.
-
Known Good Versions: All known good versions. Longer API response, not pre-grouped per release channel. Good fit if you have a hardcoded old version that you want to resolve a download URL for.
For detailed documentation on these APIs, see the official Chrome for Testing documentation.
§Features
- Ease of Use: Simplifies interaction with Chrome’s testing-related APIs.
- Type-Safe Deserialization: Automatically maps JSON responses to Rust structs for seamless API interaction.
- Asynchronous Support: Fully asynchronous.
§Example Usage
#[tokio::main]
async fn main() {
use chrome_for_testing::KnownGoodVersions;
let client = reqwest::Client::new();
match KnownGoodVersions::fetch(&client).await {
Ok(data) => println!("Successfully fetched Chrome versions: {data:?}"),
Err(e) => println!("Error occurred: {e:?}"),
}
}Modules§
- chromedriver
ChromeDriverspecific utilities, such as log level configuration.
Structs§
- Download
- Represents a download link for a specific platform.
- Known
Good Downloads - Download links for Chrome and
ChromeDriverbinaries. - Known
Good Versions - Response structure for the “known good versions” API endpoint.
- Last
Known Good Downloads - Download links for Chrome,
ChromeDriver, and Chrome Headless Shell binaries for various platforms. - Last
Known Good Versions - Response structure for the “last known good versions” API endpoint.
- Parse
Channel Error - Error returned when parsing a channel string fails.
- Parse
Platform Error - Error returned when parsing a platform string fails.
- Parse
Version Error - Error returned when parsing a version string fails.
- Version
- A version identifier.
- Version
InChannel - A Chrome version entry with channel information.
- Version
Without Channel - An entry of the “known good versions” API response, representing one version.
Enums§
- Channel
- Chrome release channel.
- Error
- Errors that can occur when using this crate.
- Platform
- Supported platforms for Chrome and
ChromeDriverdownloads.
Traits§
- Downloads
ByPlatform - Extension trait for download slices, providing platform-based lookup.
- HasVersion
- Trait for types that contain a version identifier.