Documentation ¶
Index ¶
- Constants
- Variables
- type FakeDriver
- func (w *FakeDriver) Check(selector string) bool
- func (f *FakeDriver) Click(is_xpath bool, arg string) bool
- func (w *FakeDriver) ClickClosestTo(selector1 string, selector2 string) bool
- func (w *FakeDriver) ClickNth(arg string, nth int) bool
- func (w *FakeDriver) ClickOnText(selector string, text string) bool
- func (w *FakeDriver) ExecuteJavascript(jsString string) bool
- func (f *FakeDriver) GoToNthWindow(arg int) bool
- func (f *FakeDriver) HasText(arg string, arg2 string) bool
- func (f *FakeDriver) Input(is_xpath bool, arg string, text string) bool
- func (w *FakeDriver) InputEmpty(text string) bool
- func (f *FakeDriver) Log(arg string) bool
- func (f *FakeDriver) Navigate(arg string) bool
- func (f *FakeDriver) NewPage(arg string) bool
- func (f *FakeDriver) Read(arg string) (string, bool)
- func (w *FakeDriver) Select(selector string, text string) bool
- func (w *FakeDriver) SelectEmpty(text string) bool
- func (w *FakeDriver) SendKey(keycode string) bool
- func (f *FakeDriver) Start()
- func (f *FakeDriver) Stop()
- func (w *FakeDriver) WindowSize(width, height int) bool
- type TestDriver
- type WebDriver
- func (w *WebDriver) Check(arg string) bool
- func (w *WebDriver) Click(is_xpath bool, arg string) bool
- func (w *WebDriver) ClickClosestTo(selector1 string, selector2 string) bool
- func (w *WebDriver) ClickNth(arg string, nth int) bool
- func (w *WebDriver) ClickOnText(selector string, text string) bool
- func (w *WebDriver) ExecuteJavascript(jsString string) bool
- func (w *WebDriver) GoToNthWindow(nth int) bool
- func (w *WebDriver) HasText(arg string, arg2 string) bool
- func (w *WebDriver) Init(driverType *string)
- func (w *WebDriver) Input(is_xpath bool, arg string, text string) bool
- func (w *WebDriver) InputEmpty(text string) bool
- func (w *WebDriver) Log(arg string) bool
- func (w *WebDriver) Navigate(arg string) bool
- func (w *WebDriver) NewPage(arg string) bool
- func (w *WebDriver) Read(arg string) (string, bool)
- func (w *WebDriver) Select(arg string, text string) bool
- func (w *WebDriver) SelectEmpty(text string) bool
- func (w *WebDriver) SendKey(keycode string) bool
- func (w *WebDriver) Start()
- func (w *WebDriver) Stop()
- func (w *WebDriver) WindowSize(width, height int) bool
Constants ¶
View Source
const JsActiveElement = `
document.activeElement.setAttribute('data-sailfoot-active-element', '');
return 1;
`
View Source
const JsActiveElementReset = `document.querySelector('[data-sailfoot-empty]').removeAttribute('data-sailfoot-active-element');`
View Source
const JsClickClosest = `` /* 608-byte string literal not displayed */
View Source
const JsClickWithText = `` /* 595-byte string literal not displayed */
View Source
const JsHasText = `
var containsText = document.body.innerText.includes(text);
return containsText ? 1 : 0;
`
View Source
const JsInputEmpty = `` /* 353-byte string literal not displayed */
View Source
const JsInputEmptyReset = `document.querySelector('input[data-sailfoot-empty]').removeAttribute('data-sailfoot-empty');`
View Source
const JsSelectEmpty = `` /* 275-byte string literal not displayed */
View Source
const JsSelectEmptyReset = `document.querySelector('input[data-sailfoot-empty]').removeAttribute('data-sailfoot-empty');`
Variables ¶
View Source
var WEBDRIVER_KEYCODES = map[string]string{ "NullKey": string('\ue000'), "CancelKey": string('\ue001'), "HelpKey": string('\ue002'), "BackspaceKey": string('\ue003'), "TabKey": string('\ue004'), "ClearKey": string('\ue005'), "ReturnKey": string('\ue006'), "EnterKey": string('\ue007'), "ShiftKey": string('\ue008'), "ControlKey": string('\ue009'), "AltKey": string('\ue00a'), "PauseKey": string('\ue00b'), "EscapeKey": string('\ue00c'), "SpaceKey": string('\ue00d'), "PageUpKey": string('\ue00e'), "PageDownKey": string('\ue00f'), "EndKey": string('\ue010'), "HomeKey": string('\ue011'), "LeftArrowKey": string('\ue012'), "UpArrowKey": string('\ue013'), "RightArrowKey": string('\ue014'), "DownArrowKey": string('\ue015'), "InsertKey": string('\ue016'), "DeleteKey": string('\ue017'), "SemicolonKey": string('\ue018'), "EqualsKey": string('\ue019'), "Numpad0Key": string('\ue01a'), "Numpad1Key": string('\ue01b'), "Numpad2Key": string('\ue01c'), "Numpad3Key": string('\ue01d'), "Numpad4Key": string('\ue01e'), "Numpad5Key": string('\ue01f'), "Numpad6Key": string('\ue020'), "Numpad7Key": string('\ue021'), "Numpad8Key": string('\ue022'), "Numpad9Key": string('\ue023'), "MultiplyKey": string('\ue024'), "AddKey": string('\ue025'), "SeparatorKey": string('\ue026'), "SubstractKey": string('\ue027'), "DecimalKey": string('\ue028'), "DivideKey": string('\ue029'), "F1Key": string('\ue031'), "F2Key": string('\ue032'), "F3Key": string('\ue033'), "F4Key": string('\ue034'), "F5Key": string('\ue035'), "F6Key": string('\ue036'), "F7Key": string('\ue037'), "F8Key": string('\ue038'), "F9Key": string('\ue039'), "F10Key": string('\ue03a'), "F11Key": string('\ue03b'), "F12Key": string('\ue03c'), "MetaKey": string('\ue03d'), }
WEBDRIVER_KEYCODES defines common keycodes. You can use the keyword SendKey to send them, eg. "SendKey EnterKey".
Functions ¶
This section is empty.
Types ¶
type FakeDriver ¶
type FakeDriver struct { }
func (*FakeDriver) Check ¶
func (w *FakeDriver) Check(selector string) bool
func (*FakeDriver) ClickClosestTo ¶
func (w *FakeDriver) ClickClosestTo(selector1 string, selector2 string) bool
func (*FakeDriver) ClickOnText ¶
func (w *FakeDriver) ClickOnText(selector string, text string) bool
func (*FakeDriver) ExecuteJavascript ¶
func (w *FakeDriver) ExecuteJavascript(jsString string) bool
func (*FakeDriver) GoToNthWindow ¶
func (f *FakeDriver) GoToNthWindow(arg int) bool
func (*FakeDriver) InputEmpty ¶
func (w *FakeDriver) InputEmpty(text string) bool
func (*FakeDriver) Log ¶
func (f *FakeDriver) Log(arg string) bool
func (*FakeDriver) Navigate ¶
func (f *FakeDriver) Navigate(arg string) bool
func (*FakeDriver) NewPage ¶
func (f *FakeDriver) NewPage(arg string) bool
func (*FakeDriver) SelectEmpty ¶
func (w *FakeDriver) SelectEmpty(text string) bool
func (*FakeDriver) SendKey ¶
func (w *FakeDriver) SendKey(keycode string) bool
func (*FakeDriver) Start ¶
func (f *FakeDriver) Start()
func (*FakeDriver) Stop ¶
func (f *FakeDriver) Stop()
func (*FakeDriver) WindowSize ¶
func (w *FakeDriver) WindowSize(width, height int) bool
type TestDriver ¶
type TestDriver interface { Start() Stop() Click(bool, string) bool ClickNth(string, int) bool ClickClosestTo(string, string) bool NewPage(string) bool GoToNthWindow(int) bool HasText(string, string) bool Input(bool, string, string) bool InputEmpty(string) bool Select(string, string) bool SelectEmpty(string) bool Check(string) bool Log(string) bool Read(string) (string, bool) ExecuteJavascript(string) bool ClickOnText(string, string) bool SendKey(string) bool WindowSize(int, int) bool }
TestDriver is and interface that exposes all browser functionality. Current implementing classes: FakeDriver, WebDriver (written with Agouti)
type WebDriver ¶
type WebDriver struct {
// contains filtered or unexported fields
}
func (*WebDriver) ClickClosestTo ¶
func (*WebDriver) ExecuteJavascript ¶
func (*WebDriver) GoToNthWindow ¶
func (*WebDriver) InputEmpty ¶
func (*WebDriver) SelectEmpty ¶
func (*WebDriver) WindowSize ¶
WindowSize resizes the browser window to width x height.
Click to show internal directories.
Click to hide internal directories.