Documentation
¶
Index ¶
- func NewBenchmarkBrowser(b *testing.B, opts ...BrowserOption) *rod.Browser
- func NewBenchmarkPage(b *testing.B, browser *rod.Browser) *rod.Page
- func NewTestBrowser(t *testing.T, opts ...BrowserOption) *rod.Browser
- func NewTestPage(t *testing.T, browser *rod.Browser) *rod.Page
- type BrowserOption
- type TestBrowserConfig
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 ¶
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")
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 ¶
TestBrowserConfig holds configuration for test browser
Click to show internal directories.
Click to hide internal directories.