Skip to content

Commit

Permalink
Map Page.setChecked
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Aug 6, 2024
1 parent 05a06f2 commit b0619f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions browser/mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ type pageAPI interface {
Reload(opts sobek.Value) *common.Response
Screenshot(opts sobek.Value) ([]byte, error)
SelectOption(selector string, values sobek.Value, opts sobek.Value) ([]string, error)
SetChecked(selector string, checked bool, opts sobek.Value) error
SetContent(html string, opts sobek.Value) error
SetDefaultNavigationTimeout(timeout int64)
SetDefaultTimeout(timeout int64)
Expand Down
5 changes: 5 additions & 0 deletions browser/page_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ func mapPage(vu moduleVU, p *common.Page) mapping { //nolint:gocognit,cyclop
return p.SelectOption(selector, values, opts) //nolint:wrapcheck
})
},
"setChecked": func(selector string, checked bool, opts sobek.Value) *sobek.Promise {
return k6ext.Promise(vu.Context(), func() (any, error) {
return nil, p.SetChecked(selector, checked, opts) //nolint:wrapcheck
})
},
"setContent": func(html string, opts sobek.Value) *sobek.Promise {
return k6ext.Promise(vu.Context(), func() (any, error) {
return nil, p.SetContent(html, opts) //nolint:wrapcheck
Expand Down

0 comments on commit b0619f5

Please sign in to comment.