butterbee/config/capabilities

This module provides functionality for parsing and creating capabilities requests from TOML configuration files for WebDriver(state) BiDi sessions.

In browser automation contexts, capabilities define the desired properties and features that a WebDriver(state) session should support. They specify requirements like browser version, platform, extensions, timeouts, and other session-specific configurations. Capabilities are used during session negotiation to match the requested features with what the browser/driver can provide.

The capabilities matching process typically involves:

TOML Configuration Format

The capabilities are defined under the [tools.butterbee.capabilities] section of your gleam.toml file:

# gleam.toml
# TODO: add realistic example here, the current example works but is not realistic

[tools.butterbee.capabilities.always_match]
webSocketUrl = true
"goog:chromeOptions" = { args = ["--headless=new"] }

[[tools.butterbee.capabilities.first_match]]
browserVersion = "latest"
"chrome:options" = { debuggerAddress = "localhost:9222" }

[[tools.butterbee.capabilities.first_match]]
"moz:firefoxOptions" = { binary = "/usr/bin/firefox", args = [
  "-headless",
  "-safe-mode",
], prefs = { "dom.webnotifications.enabled" = false }, log = { level = "trace" } }
browserVersion = "stable"
}

Values

pub fn default() -> capabilities_request.CapabilitiesRequest

Creates a default CapabilitiesRequest with only the webSocketUrl capability for always_match.

Search Document