allwright

API ReferencePythonConfig

Config

allwright.config.yaml (or .json) drives browser choice, timeouts, and named profiles without writing it in code. Every client picks the file up the same way.

resolve_config

FunctionSince v0.0.27 – v0.0.30

Locates (or uses a given) config file, applies a named suite override, and merges it into a flat ResolvedConfig.

def resolve_config(options: ResolveConfigOptions | None = None) -> ResolvedConfig

Example

config = resolve_config(ResolveConfigOptions(suite="smoke"))

find_config_file / load_config_file

FunctionSince v0.0.27 – v0.0.30

Walks up from a directory looking for allwright.config.{yaml,yml,json}, then parses one into an AllwrightConfig.

def find_config_file(start_dir: str | Path | None = None) -> Path | None
def load_config_file(config_file: str | Path) -> AllwrightConfig

launch_configured_browser

FunctionSince v0.0.27 – v0.0.30

Launches whichever browser a ResolvedConfig names, applying its server address and launch options first.

def launch_configured_browser(config: ResolvedConfig) -> Browser

CommandOptions

TypeSince v0.0.14

Generic per-call timeout dataclass accepted by most Page/Locator/Mobile methods.

CommandOptions(timeout_ms: int | None = None)