testing

package
v0.0.0-...-a68991e Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBenchmarkBrowser

func NewBenchmarkBrowser(b *testing.B, opts ...BrowserOption) *rod.Browser

NewBenchmarkBrowser creates a new browser for benchmarking. The browser is automatically closed when the benchmark finishes.

Usage:

browser := testing.NewBenchmarkBrowser(b)
page := browser.MustPage("https://example.com")

func NewBenchmarkPage

func NewBenchmarkPage(b *testing.B, browser *rod.Browser) *rod.Page

NewBenchmarkPage creates a new page for benchmarking. The page is automatically closed when the benchmark finishes.

Usage:

page := testing.NewBenchmarkPage(b, browser)

func NewTestBrowser

func NewTestBrowser(t *testing.T, opts ...BrowserOption) *rod.Browser

NewTestBrowser creates a new browser for testing. The browser is automatically closed when the test finishes.

Usage:

browser := testing.NewTestBrowser(t)
page := browser.MustPage("https://example.com")

func NewTestPage

func NewTestPage(t *testing.T, browser *rod.Browser) *rod.Page

NewTestPage creates a new page for testing. The page is automatically closed when the test finishes.

Usage:

page := testing.NewTestPage(t, browser)

Types

type BrowserOption

type BrowserOption func(*TestBrowserConfig)

BrowserOption is a function that configures TestBrowserConfig

func WithTimeout

func WithTimeout(timeout time.Duration) BrowserOption

WithTimeout sets the browser timeout

type TestBrowserConfig

type TestBrowserConfig struct {
	Timeout time.Duration
}

TestBrowserConfig holds configuration for test browser

Jump to

Keyboard shortcuts

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