API ReferenceGoConfig
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.
ResolveConfig
FunctionSince v0.0.27 – v0.0.30
Finds and loads a config file (or uses ResolveConfigOptions.ConfigFile), applies a named suite override, and merges it into a flat ResolvedConfig.
func ResolveConfig(options ResolveConfigOptions) (*ResolvedConfig, error)Example
cfg, err := allwright.ResolveConfig(allwright.ResolveConfigOptions{Suite: "smoke"})FindConfigFile / LoadConfigFile
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.
func FindConfigFile(startDir string) (string, error)
func LoadConfigFile(path string) (*AllwrightConfig, error)LaunchConfiguredBrowser
FunctionSince v0.0.27 – v0.0.30
Launches whichever browser a ResolvedConfig names, applying its server address and launch options first.
func LaunchConfiguredBrowser(ctx context.Context, config *ResolvedConfig) (*Browser, error)CommandOptions
TypeSince v0.0.14
Generic per-call timeout accepted by most Page/Locator/Mobile methods as a variadic trailing argument.
type CommandOptions struct {
Timeout time.Duration
}RetryConfig
TypeSince v0.0.27 – v0.0.30
The retry/poll timing policy set in a config file's expect section and merged into ResolvedConfig.
type RetryConfig struct {
TimeoutMs, IntervalMs uint32
}