Skip to content

Commit 4bdc109

Browse files
committed
Update to use retry for other pointer locator API
1 parent 1da2eaa commit 4bdc109

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/js/modules/k6/browser/common/locator.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ func (l *Locator) Dblclick(opts sobek.Value) error {
160160
// error, or applies slow motion.
161161
func (l *Locator) dblclick(opts *FrameDblclickOptions) error {
162162
opts.Strict = true
163+
opts.retry = true
163164
return l.frame.dblclick(l.selector, opts)
164165
}
165166

@@ -186,6 +187,7 @@ func (l *Locator) SetChecked(checked bool, opts sobek.Value) error {
186187

187188
func (l *Locator) setChecked(checked bool, opts *FrameCheckOptions) error {
188189
opts.Strict = true
190+
opts.retry = true
189191
return l.frame.setChecked(l.selector, checked, opts)
190192
}
191193

@@ -210,6 +212,7 @@ func (l *Locator) Check(opts sobek.Value) error {
210212
// error, or applies slow motion.
211213
func (l *Locator) check(opts *FrameCheckOptions) error {
212214
opts.Strict = true
215+
opts.retry = true
213216
return l.frame.check(l.selector, opts)
214217
}
215218

@@ -234,6 +237,7 @@ func (l *Locator) Uncheck(opts sobek.Value) error {
234237
// an error, or applies slow motion.
235238
func (l *Locator) uncheck(opts *FrameUncheckOptions) error {
236239
opts.Strict = true
240+
opts.retry = true
237241
return l.frame.uncheck(l.selector, opts)
238242
}
239243

@@ -733,6 +737,7 @@ func (l *Locator) Hover(opts sobek.Value) error {
733737

734738
func (l *Locator) hover(opts *FrameHoverOptions) error {
735739
opts.Strict = true
740+
opts.retry = true
736741
return l.frame.hover(l.selector, opts)
737742
}
738743

@@ -741,6 +746,7 @@ func (l *Locator) Tap(opts *FrameTapOptions) error {
741746
l.log.Debugf("Locator:Tap", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)
742747

743748
opts.Strict = true
749+
opts.retry = true
744750
if err := l.frame.tap(l.selector, opts); err != nil {
745751
return fmt.Errorf("tapping on %q: %w", l.selector, err)
746752
}

0 commit comments

Comments
 (0)