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 10, 2024
1 parent 27371aa commit f59c1f7
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 f59c1f7

Please sign in to comment.