1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-14 11:23:02 +02:00
ferret/pkg/stdlib/html/lib.go

36 lines
872 B
Go
Raw Normal View History

2018-09-18 22:42:38 +02:00
package html
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,
"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,
"NAVIGATE_BACK": NavigateBack,
"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,
"SCREENSHOT": Screenshot,
2018-09-18 22:42:38 +02:00
}
}