Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Move Locator.tap into Locator.Tap
Browse files Browse the repository at this point in the history
We'll remove option parsing from Tap soon. So, there won't be a need for
another `tap` method.
  • Loading branch information
inancgumus committed Apr 17, 2024
1 parent 2f3be40 commit e09c4a8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions common/locator.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ func (l *Locator) Tap(opts goja.Value) error {
if err := copts.Parse(l.ctx, opts); err != nil {
return fmt.Errorf("parsing tap options: %w", err)
}
if err := l.tap(copts); err != nil {
copts.Strict = true
if err := l.frame.tap(l.selector, copts); err != nil {
return fmt.Errorf("tapping on %q: %w", l.selector, err)
}

Expand All @@ -577,11 +578,6 @@ func (l *Locator) Tap(opts goja.Value) error {
return nil
}

func (l *Locator) tap(opts *FrameTapOptions) error {
opts.Strict = true
return l.frame.tap(l.selector, opts)
}

// DispatchEvent dispatches an event for the element matching the
// locator's selector with strict mode on.
func (l *Locator) DispatchEvent(typ string, eventInit any, opts *FrameDispatchEventOptions) error {
Expand Down

0 comments on commit e09c4a8

Please sign in to comment.