Skip to content

Commit

Permalink
Add internal timeout method
Browse files Browse the repository at this point in the history
This method will be used in the mapping layer to instantiate a
FrameFillOptions.
  • Loading branch information
ankur22 committed Jan 4, 2024
1 parent 6a36713 commit 7829e4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/locator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package common
import (
"context"
"fmt"
"time"

"github.com/grafana/xk6-browser/k6ext"
"github.com/grafana/xk6-browser/log"
Expand Down Expand Up @@ -51,6 +52,11 @@ func (l *Locator) Clear(opts *FrameFillOptions) error {
return nil
}

// Timeout will return the default timeout or the one set by the user.
func (l *Locator) Timeout() time.Duration {
return l.frame.defaultTimeout()
}

// Click on an element using locator's selector with strict mode on.
func (l *Locator) Click(opts goja.Value) error {
l.log.Debugf("Locator:Click", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)
Expand Down

0 comments on commit 7829e4d

Please sign in to comment.