1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-05 00:49:00 +02:00

Bugfix/click (#355)

* Added ability to use ClickBySelector with an element

* Fixes

* Increased timeout time
This commit is contained in:
Tim Voronov
2019-08-24 20:26:27 -04:00
committed by GitHub
parent 70b17ce755
commit f39face8bf
15 changed files with 74 additions and 40 deletions

View File

@ -19,7 +19,7 @@ func ClickAll(ctx context.Context, args ...core.Value) (core.Value, error) {
return values.False, err
}
doc, err := drivers.ToDocument(args[0])
el, err := drivers.ToElement(args[0])
if err != nil {
return values.None, err
@ -27,7 +27,7 @@ func ClickAll(ctx context.Context, args ...core.Value) (core.Value, error) {
selector := values.ToString(args[1])
exists, err := doc.ExistsBySelector(ctx, selector)
exists, err := el.ExistsBySelector(ctx, selector)
if err != nil {
return values.False, err
@ -37,5 +37,5 @@ func ClickAll(ctx context.Context, args ...core.Value) (core.Value, error) {
return values.False, nil
}
return values.True, doc.ClickBySelectorAll(ctx, selector)
return values.True, el.ClickBySelectorAll(ctx, selector)
}