chrome-for-testing
Provides serde-enabled type definitions covering the main chrome-for-testing JSON API responses
with download URLs, and programmatic access to those endpoints through reqwest, allowing you to
fetch information about available Chrome, ChromeDriver, and Chrome Headless Shell versions for
automated testing.
Links
- Blog post: Chrome for Testing announcement
- Live API: Chrome for Testing availability
- API documentation: JSON API endpoints
- Crate documentation: docs.rs
Related Crates
chrome-for-testing-manager
You may want to check out chrome-for-testing-manager, a
crate building upon this one to allow easy selection and installation of chrome-for-testing versions.
It also comes with support for the thirtyfour WebDriver crate.
Installation
Add this to your Cargo.toml:
[]
= "0.4"
Or use cargo add:
cargo add chrome-for-testing
Features
- Type-safe API access - Serde-enabled type definitions for the main API responses with download URLs.
- Async support - Built on
reqwestfor non-blocking HTTP requests. - Provides access to the following APIs:
KnownGoodVersions- Get all historical Chrome versions.LastKnownGoodVersions- Get latest versions for each release channel.
- Platform detection - Automatically detect the current platform (os/arch) to filter responses.
- Typed URL access - Parse download URL strings into
url::Urlvalues withDownload::parsed_url(). - ChromeDriver utilities - Additional tools for ChromeDriver configuration.
Usage
Getting the "Last Known Good Versions"
Use this API if you just want to know the latest version of one particular (or multiple) release channels.
use ;
async
Getting all "Known Good Versions"
Use this API if you just want to know all historical version. Particularly useful if you plan to run a fixed version.
This example also shows how the Platform type can be used to filter available download URLs for the current platform.
use ;
async
Fetch and platform detection APIs return chrome_for_testing::Result<T>, a rootcause typed error report. If
your application uses a generic error boundary, convert the report with err.into_boxed_error().
Modeled API's
This crate currently models
| Modeled | Endpoint | Description |
|---|---|---|
| no | known-good-versions.json | The versions for which all CfT assets are available for download. Useful for bisecting. |
| yes | known-good-versions-with-downloads.json | Same as above, but with an extra downloads property for each version, listing the full download URLs per asset. |
| no | last-known-good-versions.json | The latest versions for which all CfT assets are available for download, for each Chrome release channel (Stable/Beta/Dev/Canary). |
| yes | last-known-good-versions-with-downloads.json | Same as above, but with an extra downloads property for each channel, listing the full download URLs per asset. |
| no | latest-patch-versions-per-build.json | The latest versions for which all CfT assets are available for download, for each known combination of MAJOR.MINOR.BUILD versions. |
| no | latest-patch-versions-per-build-with-downloads.json | Same as above, but with an extra downloads property for each version, listing the full download URLs per asset. |
| no | latest-versions-per-milestone.json | The latest versions for which all CfT assets are available for download, for each Chrome milestone. |
| no | latest-versions-per-milestone-with-downloads.json | Same as above, but with an extra downloads property for each milestone, listing the full download URLs per asset. |
The (historical) LATEST_RELEASE_* endpoints are also not modeled.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.