browsertest

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBrowser

func InitBrowser(
	t testing.TB,
	handler http.Handler,
	engine html.ScriptEngine,
	opts ...InitOption,
) htmltest.BrowserHelper

InitBrowser creates a browser with a script engine and a default set of options. If no engine is passed, V8 will be used.

This browser will be configured to log to the t instance. As a consequence, uncaught JavaScript errors will result in a test error.

func InitWindow

func InitWindow(t testing.TB, engine html.ScriptEngine, opts ...InitOption) htmltest.WindowHelper

InitWindow creates a browser and an empty window with a script engine and a default set of options.

See also: InitBrowser

Types

type InitOption added in v0.11.0

type InitOption func(*option)

func WithHtml added in v0.11.0

func WithHtml(html string) InitOption

func WithIgnoreErrorLogs added in v0.11.0

func WithIgnoreErrorLogs() InitOption

By default, log entries of Error log level cause the test to fail. This option will suppress that behaviour; for when verifying explicit error scenarios.

func WithLogOption added in v0.11.0

func WithLogOption(lo gosttest.HandlerOption) InitOption

func WithMinLogLevel added in v0.11.0

func WithMinLogLevel(lvl slog.Level) InitOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL