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:
@ -15,7 +15,7 @@ import (
|
||||
// @param value (String) - Target value.
|
||||
// @param delay (Int, optional) - Waits delay milliseconds between keystrokes
|
||||
// @returns (Boolean) - Returns true if an element was found.
|
||||
func Input(_ context.Context, args ...core.Value) (core.Value, error) {
|
||||
func Input(ctx context.Context, args ...core.Value) (core.Value, error) {
|
||||
err := core.ValidateArgs(args, 2, 4)
|
||||
|
||||
if err != nil {
|
||||
@ -54,7 +54,7 @@ func Input(_ context.Context, args ...core.Value) (core.Value, error) {
|
||||
delay = arg4.(values.Int)
|
||||
}
|
||||
|
||||
return doc.InputBySelector(arg2.(values.String), args[2], delay)
|
||||
return doc.InputBySelector(ctx, arg2.(values.String), args[2], delay)
|
||||
}
|
||||
|
||||
el := arg1.(drivers.HTMLElement)
|
||||
@ -72,7 +72,7 @@ func Input(_ context.Context, args ...core.Value) (core.Value, error) {
|
||||
delay = arg3.(values.Int)
|
||||
}
|
||||
|
||||
err = el.Input(args[1], delay)
|
||||
err = el.Input(ctx, args[1], delay)
|
||||
|
||||
if err != nil {
|
||||
return values.False, err
|
||||
|
Reference in New Issue
Block a user