Documentation
¶
Index ¶
- func Request(data map[string]any, opts ...Option) (map[string]any, error)
- type BrowserRunner
- type Callback
- type ChromeDPAction
- type ChromeDPRunner
- type MockRunner
- func (m *MockRunner) GetAllCalls() [][]chromedp.Action
- func (m *MockRunner) GetCallCount() int
- func (m *MockRunner) GetLastCall() []chromedp.Action
- func (m *MockRunner) Run(ctx context.Context, actions ...chromedp.Action) error
- func (m *MockRunner) SetRunFunc(fn func(ctx context.Context, actions ...chromedp.Action) error)
- type Option
- type Req
- type Res
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BrowserRunner ¶
BrowserRunner defines the interface for running browser actions
type ChromeDPAction ¶
type ChromeDPAction struct {
ID string `map:"id"`
Name string `map:"name"`
URL string `map:"url"`
Selector string `map:"selector"`
Attribute []string `map:"attribute"`
Value string `map:"value"`
Path string `map:"path"` // Deprecated: use FilePath from results
Quality int `map:"quality"`
// contains filtered or unexported fields
}
func NewChromeDPAction ¶
func NewChromeDPAction() *ChromeDPAction
type ChromeDPRunner ¶
type ChromeDPRunner struct{}
ChromeDPRunner implements BrowserRunner using the actual ChromeDP
type MockRunner ¶
type MockRunner struct {
RunFunc func(ctx context.Context, actions ...chromedp.Action) error
CallHistory [][]chromedp.Action
// contains filtered or unexported fields
}
MockRunner implements BrowserRunner for testing
func NewMockRunner ¶
func NewMockRunner() *MockRunner
NewMockRunner creates a new mock browser runner
func (*MockRunner) GetAllCalls ¶
func (m *MockRunner) GetAllCalls() [][]chromedp.Action
GetAllCalls returns all recorded Run calls
func (*MockRunner) GetCallCount ¶
func (m *MockRunner) GetCallCount() int
GetCallCount returns the number of Run calls made
func (*MockRunner) GetLastCall ¶
func (m *MockRunner) GetLastCall() []chromedp.Action
GetLastCall returns the actions from the most recent Run call
func (*MockRunner) SetRunFunc ¶
SetRunFunc sets a custom function to execute when Run is called
type Req ¶
Click to show internal directories.
Click to hide internal directories.