Documentation ¶
Index ¶
- Variables
- type AgoutiDriver
- type AgoutiPage
- func (m *AgoutiPage) CancelPopup() error
- func (m *AgoutiPage) ConfirmPopup() error
- func (m *AgoutiPage) EnterPopupText(text string) error
- func (m *AgoutiPage) Navigate(url string) error
- func (m *AgoutiPage) PopupText() (string, error)
- func (m *AgoutiPage) Refresh() error
- func (m *AgoutiPage) RunScript(body string, arguments map[string]interface{}, result interface{}) error
- func (m *AgoutiPage) Screenshot(filename string) error
- func (m *AgoutiPage) Session() SessionService
- func (m *AgoutiPage) Size(width, height int) error
- func (m *AgoutiPage) SwitchToRootFrame() error
- func (m *AgoutiPage) URL() (string, error)
- func (m *AgoutiPage) WindowCount() (int, error)
- type AgoutiSelector
- func (m *AgoutiSelector) All(selector string) *agouti.MultiSelection
- func (m *AgoutiSelector) AllByButton(text string) *agouti.MultiSelection
- func (m *AgoutiSelector) AllByClass(text string) *agouti.MultiSelection
- func (m *AgoutiSelector) AllByID(text string) *agouti.MultiSelection
- func (m *AgoutiSelector) AllByLabel(text string) *agouti.MultiSelection
- func (m *AgoutiSelector) AllByLink(text string) *agouti.MultiSelection
- func (m *AgoutiSelector) AllByName(name string) *agouti.MultiSelection
- func (m *AgoutiSelector) AllByXPath(selector string) *agouti.MultiSelection
- func (m *AgoutiSelector) First(selector string) *agouti.Selection
- func (m *AgoutiSelector) FirstByLink(text string) *agouti.Selection
- type DriverService
- type MockDriver
- type MockPage
- func (m *MockPage) CancelPopup() error
- func (m *MockPage) ConfirmPopup() error
- func (m *MockPage) EnterPopupText(text string) error
- func (m *MockPage) Navigate(url string) error
- func (m *MockPage) PopupText() (string, error)
- func (m *MockPage) Refresh() error
- func (m *MockPage) RunScript(body string, arguments map[string]interface{}, result interface{}) error
- func (m *MockPage) Screenshot(filename string) error
- func (m *MockPage) Session() SessionService
- func (m *MockPage) Size(width, height int) error
- func (m *MockPage) SwitchToRootFrame() error
- func (m *MockPage) URL() (string, error)
- func (m *MockPage) WindowCount() (int, error)
- type MockSelectable
- func (m *MockSelectable) All(selector string) *agouti.MultiSelection
- func (m *MockSelectable) AllByButton(text string) *agouti.MultiSelection
- func (m *MockSelectable) AllByClass(text string) *agouti.MultiSelection
- func (m *MockSelectable) AllByID(text string) *agouti.MultiSelection
- func (m *MockSelectable) AllByLabel(text string) *agouti.MultiSelection
- func (m *MockSelectable) AllByLink(text string) *agouti.MultiSelection
- func (m *MockSelectable) AllByName(name string) *agouti.MultiSelection
- func (m *MockSelectable) AllByXPath(selector string) *agouti.MultiSelection
- func (m *MockSelectable) First(selector string) *agouti.Selection
- func (m *MockSelectable) FirstByLink(text string) *agouti.Selection
- type MockSession
- type PageService
- type SelectorService
- type SessionService
Constants ¶
This section is empty.
Variables ¶
var UnitTestingMockDriver = new(MockDriver)
UnitTestingMockDriver is the driver returned when unit testing
Functions ¶
This section is empty.
Types ¶
type AgoutiDriver ¶
type AgoutiDriver struct {
// contains filtered or unexported fields
}
AgoutiDriver wraps an agouti driver as an adapter
func (*AgoutiDriver) NewPage ¶
func (d *AgoutiDriver) NewPage(options ...agouti.Option) (PageService, error)
NewPage opens a new browser session/page
func (*AgoutiDriver) URL ¶
func (d *AgoutiDriver) URL() string
URL returns the URL of the driver endpoint
type AgoutiPage ¶
type AgoutiPage struct { SelectorService // contains filtered or unexported fields }
AgoutiPage wraps an agouti.Page as an adapter
func (*AgoutiPage) CancelPopup ¶
func (m *AgoutiPage) CancelPopup() error
CancelPopup is a mock method
func (*AgoutiPage) ConfirmPopup ¶
func (m *AgoutiPage) ConfirmPopup() error
ConfirmPopup is a mock method
func (*AgoutiPage) EnterPopupText ¶
func (m *AgoutiPage) EnterPopupText(text string) error
EnterPopupText is a mock method
func (*AgoutiPage) Navigate ¶
func (m *AgoutiPage) Navigate(url string) error
Navigate is a mock method
func (*AgoutiPage) PopupText ¶
func (m *AgoutiPage) PopupText() (string, error)
PopupText is a mock method
func (*AgoutiPage) RunScript ¶
func (m *AgoutiPage) RunScript(body string, arguments map[string]interface{}, result interface{}) error
RunScript is a mock method
func (*AgoutiPage) Screenshot ¶
func (m *AgoutiPage) Screenshot(filename string) error
Screenshot is a mock method
func (*AgoutiPage) SwitchToRootFrame ¶
func (m *AgoutiPage) SwitchToRootFrame() error
SwitchToRootFrame is a mock method
func (*AgoutiPage) WindowCount ¶
func (m *AgoutiPage) WindowCount() (int, error)
WindowCount is a mock method
type AgoutiSelector ¶
type AgoutiSelector struct {
// contains filtered or unexported fields
}
AgoutiSelector wraps an *agouti.Page to adapt its selectable methods
func (*AgoutiSelector) All ¶
func (m *AgoutiSelector) All(selector string) *agouti.MultiSelection
All is a mock method
func (*AgoutiSelector) AllByButton ¶
func (m *AgoutiSelector) AllByButton(text string) *agouti.MultiSelection
AllByButton is a mock method
func (*AgoutiSelector) AllByClass ¶
func (m *AgoutiSelector) AllByClass(text string) *agouti.MultiSelection
AllByClass is a mock method
func (*AgoutiSelector) AllByID ¶
func (m *AgoutiSelector) AllByID(text string) *agouti.MultiSelection
AllByID is a mock method
func (*AgoutiSelector) AllByLabel ¶
func (m *AgoutiSelector) AllByLabel(text string) *agouti.MultiSelection
AllByLabel is a mock method
func (*AgoutiSelector) AllByLink ¶
func (m *AgoutiSelector) AllByLink(text string) *agouti.MultiSelection
AllByLink is a mock method
func (*AgoutiSelector) AllByName ¶
func (m *AgoutiSelector) AllByName(name string) *agouti.MultiSelection
AllByName is a mock method
func (*AgoutiSelector) AllByXPath ¶
func (m *AgoutiSelector) AllByXPath(selector string) *agouti.MultiSelection
AllByXPath is a mock method
func (*AgoutiSelector) First ¶
func (m *AgoutiSelector) First(selector string) *agouti.Selection
First is a mock method
func (*AgoutiSelector) FirstByLink ¶
func (m *AgoutiSelector) FirstByLink(text string) *agouti.Selection
FirstByLink is a mock method
type DriverService ¶
type DriverService interface { URL() string Start() error Stop() error NewPage(options ...agouti.Option) (PageService, error) }
DriverService allows mocking of agouti.WebDriver
func NewDriverService ¶
func NewDriverService(agoutiDriver *agouti.WebDriver) DriverService
NewDriverService either wraps an agouti.WebDriver (if one is provided) or a MockDriver (if nil is provided) in a DriverService.
type MockDriver ¶
MockDriver serves as a mock for unit testing
func (*MockDriver) NewPage ¶
func (d *MockDriver) NewPage(options ...agouti.Option) (PageService, error)
NewPage is a mock method for unit testing
func (*MockDriver) Start ¶
func (d *MockDriver) Start() error
Start is a mock method for unit testing
type MockPage ¶
type MockPage struct { MockSelectable mock.Mock }
MockPage is a mock of agouti.Page
func (*MockPage) ConfirmPopup ¶
ConfirmPopup is a mock method
func (*MockPage) EnterPopupText ¶
EnterPopupText is a mock method
func (*MockPage) RunScript ¶
func (m *MockPage) RunScript(body string, arguments map[string]interface{}, result interface{}) error
RunScript is a mock method
func (*MockPage) Screenshot ¶
Screenshot is a mock method
func (*MockPage) SwitchToRootFrame ¶
SwitchToRootFrame is a mock method
func (*MockPage) WindowCount ¶
WindowCount is a mock method
type MockSelectable ¶
MockSelectable is a mock of agouti.selectable
func (*MockSelectable) All ¶
func (m *MockSelectable) All(selector string) *agouti.MultiSelection
All is a mock method
func (*MockSelectable) AllByButton ¶
func (m *MockSelectable) AllByButton(text string) *agouti.MultiSelection
AllByButton is a mock method
func (*MockSelectable) AllByClass ¶
func (m *MockSelectable) AllByClass(text string) *agouti.MultiSelection
AllByClass is a mock method
func (*MockSelectable) AllByID ¶
func (m *MockSelectable) AllByID(text string) *agouti.MultiSelection
AllByID is a mock method
func (*MockSelectable) AllByLabel ¶
func (m *MockSelectable) AllByLabel(text string) *agouti.MultiSelection
AllByLabel is a mock method
func (*MockSelectable) AllByLink ¶
func (m *MockSelectable) AllByLink(text string) *agouti.MultiSelection
AllByLink is a mock method
func (*MockSelectable) AllByName ¶
func (m *MockSelectable) AllByName(name string) *agouti.MultiSelection
AllByName is a mock method
func (*MockSelectable) AllByXPath ¶
func (m *MockSelectable) AllByXPath(selector string) *agouti.MultiSelection
AllByXPath is a mock method
func (*MockSelectable) First ¶
func (m *MockSelectable) First(selector string) *agouti.Selection
First is a mock method
func (*MockSelectable) FirstByLink ¶
func (m *MockSelectable) FirstByLink(text string) *agouti.Selection
FirstByLink is a mock method
type MockSession ¶
MockSession serves as a mock for unit testing
func (*MockSession) GetActiveElement ¶
func (m *MockSession) GetActiveElement() (*api.Element, error)
GetActiveElement is a mock method
func (*MockSession) GetWindows ¶
func (m *MockSession) GetWindows() ([]*api.Window, error)
GetWindows is a mock method
type PageService ¶
type PageService interface { SelectorService Size(width, height int) error Screenshot(filename string) error WindowCount() (int, error) Session() SessionService Refresh() error RunScript(body string, arguments map[string]interface{}, result interface{}) error SwitchToRootFrame() error ConfirmPopup() error CancelPopup() error EnterPopupText(text string) error PopupText() (string, error) URL() (string, error) }
PageService allows mocking of agouti.Page
func NewPageServiceFromAgoutiPage ¶
func NewPageServiceFromAgoutiPage(page *agouti.Page) PageService
NewPageServiceFromAgoutiPage either wraps an agouti.Page (if one is provided) or a MockPage (if nil is provided) in a PageService
type SelectorService ¶
type SelectorService interface { All(selector string) *agouti.MultiSelection AllByXPath(selector string) *agouti.MultiSelection AllByLabel(text string) *agouti.MultiSelection AllByButton(text string) *agouti.MultiSelection AllByName(name string) *agouti.MultiSelection AllByLink(text string) *agouti.MultiSelection AllByID(text string) *agouti.MultiSelection AllByClass(text string) *agouti.MultiSelection FirstByLink(text string) *agouti.Selection First(selector string) *agouti.Selection }
SelectorService allows mocking agouti selectables
func NewSelectorServiceFromAgoutiPage ¶
func NewSelectorServiceFromAgoutiPage(page *agouti.Page) SelectorService
NewSelectorServiceFromAgoutiPage either wraps an agouti.Page (if one is provided) or a MockSelector (if nil is provided) in a SelectorService