butterbee/config
Butterbee can be configured using the gleam.toml file.
When you call the new function in the webdriver module, butterbee tries
to parse the gleam.toml file in the root of the project. If it can’t find it,
it will use the default configuration.
For documentation see the individual config modules for more details:
Example of the default configuration in toml format:
# gleam.toml
[tools.butterbee.driver]
max_wait_time = 20000
request_timeout = 5000
data_dir = "/tmp/butterbee"
[tools.butterbee.capabilities.always_match]
webSocketUrl = true
[tools.butterbee.browser.firefox]
cmd = "firefox"
flags = []
host = "127.0.0.1"
[tools.butterbee.browser.chromium]
cmd = "chromedriver"
flags = []
host = "127.0.0.1"
Types
Represents the [tools.butterbee] section of your gleam.toml file
pub type ButterbeeConfig {
ButterbeeConfig(
driver: driver.DriverConfig,
capabilities: option.Option(
capabilities_request.CapabilitiesRequest,
),
browser_config: option.Option(
dict.Dict(browser.BrowserType, browser.BrowserConfig),
),
)
}
Constructors
-
ButterbeeConfig( driver: driver.DriverConfig, capabilities: option.Option( capabilities_request.CapabilitiesRequest, ), browser_config: option.Option( dict.Dict(browser.BrowserType, browser.BrowserConfig), ), )
Values
pub const default: ButterbeeConfig
The default config. See the toml representation of the default configuration above
pub fn parse_config_string(
toml: String,
) -> Result(ButterbeeConfig, @internal Error)
pub fn with_browser_config(
config: ButterbeeConfig,
browser_type: browser.BrowserType,
browser_config: browser.BrowserConfig,
) -> ButterbeeConfig
pub fn with_capabilities(
config: ButterbeeConfig,
capabilities: capabilities_request.CapabilitiesRequest,
) -> ButterbeeConfig
pub fn with_driver_config(
config: ButterbeeConfig,
driver: driver.DriverConfig,
) -> ButterbeeConfig