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

Commit b0619f5

Browse files
committed
Map Page.setChecked
1 parent 05a06f2 commit b0619f5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

browser/mapping_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ type pageAPI interface {
334334
Reload(opts sobek.Value) *common.Response
335335
Screenshot(opts sobek.Value) ([]byte, error)
336336
SelectOption(selector string, values sobek.Value, opts sobek.Value) ([]string, error)
337+
SetChecked(selector string, checked bool, opts sobek.Value) error
337338
SetContent(html string, opts sobek.Value) error
338339
SetDefaultNavigationTimeout(timeout int64)
339340
SetDefaultTimeout(timeout int64)

browser/page_mapping.go

+5
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ func mapPage(vu moduleVU, p *common.Page) mapping { //nolint:gocognit,cyclop
263263
return p.SelectOption(selector, values, opts) //nolint:wrapcheck
264264
})
265265
},
266+
"setChecked": func(selector string, checked bool, opts sobek.Value) *sobek.Promise {
267+
return k6ext.Promise(vu.Context(), func() (any, error) {
268+
return nil, p.SetChecked(selector, checked, opts) //nolint:wrapcheck
269+
})
270+
},
266271
"setContent": func(html string, opts sobek.Value) *sobek.Promise {
267272
return k6ext.Promise(vu.Context(), func() (any, error) {
268273
return nil, p.SetContent(html, opts) //nolint:wrapcheck

0 commit comments

Comments
 (0)