2018-09-18 22:42:38 +02:00
|
|
|
package html
|
|
|
|
|
2018-10-07 04:33:39 +02:00
|
|
|
import (
|
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
const defaultTimeout = 5000
|
|
|
|
|
|
|
|
var (
|
|
|
|
ErrNotDynamic = errors.New("expected dynamic document or element")
|
|
|
|
)
|
2018-09-18 22:42:38 +02:00
|
|
|
|
|
|
|
func NewLib() map[string]core.Function {
|
|
|
|
return map[string]core.Function{
|
2018-09-25 23:58:57 +02:00
|
|
|
"DOCUMENT": Document,
|
|
|
|
"DOCUMENT_PARSE": DocumentParse,
|
|
|
|
"ELEMENT": Element,
|
|
|
|
"ELEMENTS": Elements,
|
|
|
|
"WAIT_ELEMENT": WaitElement,
|
|
|
|
"WAIT_NAVIGATION": WaitNavigation,
|
2018-10-07 04:33:39 +02:00
|
|
|
"WAIT_CLASS": WaitClass,
|
|
|
|
"WAIT_CLASS_ALL": WaitClassAll,
|
2018-09-25 23:58:57 +02:00
|
|
|
"CLICK": Click,
|
2018-09-28 04:03:35 +02:00
|
|
|
"CLICK_ALL": ClickAll,
|
2018-09-26 01:04:07 +02:00
|
|
|
"NAVIGATE": Navigate,
|
2018-10-12 22:02:53 +02:00
|
|
|
"NAVIGATE_BACK": NavigateBack,
|
2018-09-28 01:05:56 +02:00
|
|
|
"INPUT": Input,
|
2018-10-06 01:40:09 +02:00
|
|
|
"INNER_HTML": InnerHTML,
|
|
|
|
"INNER_HTML_ALL": InnerHTMLAll,
|
2018-09-28 04:03:35 +02:00
|
|
|
"INNER_TEXT": InnerText,
|
|
|
|
"INNER_TEXT_ALL": InnerTextAll,
|
2018-10-08 01:02:27 +02:00
|
|
|
"SCREENSHOT": Screenshot,
|
2018-09-18 22:42:38 +02:00
|
|
|
}
|
|
|
|
}
|