From 603cec97d80255c4c8ca003b366ae620c5def06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 6 Aug 2024 13:01:45 -0400 Subject: [PATCH] Map Locator.setChecked --- browser/locator_mapping.go | 5 +++++ browser/mapping_test.go | 1 + 2 files changed, 6 insertions(+) diff --git a/browser/locator_mapping.go b/browser/locator_mapping.go index 1df2f73ec..bc014da1c 100644 --- a/browser/locator_mapping.go +++ b/browser/locator_mapping.go @@ -36,6 +36,11 @@ func mapLocator(vu moduleVU, lo *common.Locator) mapping { //nolint:funlen return nil, lo.Dblclick(opts) //nolint:wrapcheck }) }, + "setChecked": func(checked bool, opts sobek.Value) *sobek.Promise { + return k6ext.Promise(vu.Context(), func() (any, error) { + return nil, lo.SetChecked(checked, opts) //nolint:wrapcheck + }) + }, "check": func(opts sobek.Value) *sobek.Promise { return k6ext.Promise(vu.Context(), func() (any, error) { return nil, lo.Check(opts) //nolint:wrapcheck diff --git a/browser/mapping_test.go b/browser/mapping_test.go index bc4dfe51e..7dc090f73 100644 --- a/browser/mapping_test.go +++ b/browser/mapping_test.go @@ -505,6 +505,7 @@ type locatorAPI interface { Clear(opts *common.FrameFillOptions) error Click(opts sobek.Value) error Dblclick(opts sobek.Value) error + SetChecked(checked bool, opts sobek.Value) error Check(opts sobek.Value) error Uncheck(opts sobek.Value) error IsChecked(opts sobek.Value) (bool, error)