testbrowser

package
v0.0.0-...-28a10b4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Browser

type Browser struct {
	*rod.Browser
	Timeout time.Duration
	// contains filtered or unexported fields
}

func (*Browser) Page

func (b *Browser) Page() *Page

type Manager

type Manager struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

func NewManager

func NewManager(config ManagerConfig) (*Manager, error)

func (*Manager) Acquire

func (m *Manager) Acquire(t testing.TB) *Browser

Acquire returns a TestBrowser. Resources are automatically cleaned up at the end of the test.

type ManagerConfig

type ManagerConfig struct {
	MaxConcurrentTests int64
	Timeout            time.Duration
}

type Page

type Page struct {
	*rod.Page
	Timeout time.Duration
	// contains filtered or unexported fields
}

func (*Page) AcceptDialog

func (p *Page) AcceptDialog(fn func())

func (*Page) ClickOn

func (p *Page) ClickOn(jsRegex string)

func (*Page) DoesNotHaveContent

func (p *Page) DoesNotHaveContent(selector, jsRegex string)

func (*Page) ElementByLabel

func (p *Page) ElementByLabel(labelText string) *rod.Element

func (*Page) FillIn

func (p *Page) FillIn(labelOrSelector string, content string)

func (*Page) HasContent

func (p *Page) HasContent(selector, jsRegex string)

func (*Page) Scope

func (p *Page) Scope(selector string) *Scope

func (*Page) Within

func (p *Page) Within(selector string, fn func(scope *Scope))

type Scope

type Scope struct {
	// contains filtered or unexported fields
}

func (*Scope) ClickOn

func (s *Scope) ClickOn(jsRegex string)

func (*Scope) ElementByLabel

func (s *Scope) ElementByLabel(labelText string) *rod.Element

func (*Scope) FillIn

func (s *Scope) FillIn(labelOrSelector string, content string)

func (*Scope) Scope

func (s *Scope) Scope(selector string) *Scope

func (*Scope) Within

func (s *Scope) Within(selector string, fn func(scope *Scope))

Jump to

Keyboard shortcuts

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