1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-06-23 00:28:10 +02:00

Added Context to HTML methods (#235)

* Added Context to HTML methods

* Fixed unit tests

* Updated timeout

* Fixed WAIT_CLASS timeout
This commit is contained in:
Tim Voronov
2019-02-20 21:24:05 -05:00
committed by GitHub
parent 34c8c02258
commit 6e15846d0f
45 changed files with 415 additions and 446 deletions

View File

@ -10,7 +10,7 @@ import (
// Click dispatches click event on a given element
// @param source (Document | Element) - Event source.
// @param selector (String, optional) - Optional selector. Only used when a document instance is passed.
func Click(_ context.Context, args ...core.Value) (core.Value, error) {
func Click(ctx context.Context, args ...core.Value) (core.Value, error) {
err := core.ValidateArgs(args, 1, 2)
if err != nil {
@ -25,7 +25,7 @@ func Click(_ context.Context, args ...core.Value) (core.Value, error) {
return values.False, err
}
return el.Click()
return el.Click(ctx)
}
// CLICK(doc, selector)
@ -37,5 +37,5 @@ func Click(_ context.Context, args ...core.Value) (core.Value, error) {
selector := args[1].String()
return doc.ClickBySelector(values.NewString(selector))
return doc.ClickBySelector(ctx, values.NewString(selector))
}