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

Commit

Permalink
Async browsercontext addCookies
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed May 10, 2024
1 parent c68c08e commit 6e4e353
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion browser/browser_context_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import (
func mapBrowserContext(vu moduleVU, bc *common.BrowserContext) mapping { //nolint:funlen,gocognit,cyclop
rt := vu.Runtime()
return mapping{
"addCookies": bc.AddCookies,
"addCookies": func(cookies []*common.Cookie) *goja.Promise {
return k6ext.Promise(vu.Context(), func() (any, error) {
return nil, bc.AddCookies(cookies) //nolint:wrapcheck
})
},
"addInitScript": func(script goja.Value) *goja.Promise {
return k6ext.Promise(vu.Context(), func() (any, error) {
if !gojaValueExists(script) {
Expand Down

0 comments on commit 6e4e353

Please # to comment.