@@ -82,12 +82,14 @@ func mapLocator(vu moduleVU, lo *common.Locator) mapping {
82
82
"press" : lo .Press ,
83
83
"type" : lo .Type ,
84
84
"hover" : lo .Hover ,
85
- "tap" : func (opts goja.Value ) error {
85
+ "tap" : func (opts goja.Value ) ( * goja. Promise , error ) {
86
86
copts := common .NewFrameTapOptions (lo .DefaultTimeout ())
87
87
if err := copts .Parse (vu .Context (), opts ); err != nil {
88
- return fmt .Errorf ("parsing locator tap options: %w" , err )
88
+ return nil , fmt .Errorf ("parsing locator tap options: %w" , err )
89
89
}
90
- return lo .Tap (copts ) //nolint:wrapcheck
90
+ return k6ext .Promise (vu .Context (), func () (any , error ) {
91
+ return nil , lo .Tap (copts ) //nolint:wrapcheck
92
+ }), nil
91
93
},
92
94
"dispatchEvent" : func (typ string , eventInit , opts goja.Value ) error {
93
95
popts := common .NewFrameDispatchEventOptions (lo .DefaultTimeout ())
@@ -286,12 +288,14 @@ func mapElementHandle(vu moduleVU, eh *common.ElementHandle) mapping {
286
288
"selectOption" : eh .SelectOption ,
287
289
"selectText" : eh .SelectText ,
288
290
"setInputFiles" : eh .SetInputFiles ,
289
- "tap" : func (opts goja.Value ) error {
291
+ "tap" : func (opts goja.Value ) ( * goja. Promise , error ) {
290
292
popts := common .NewElementHandleTapOptions (eh .Timeout ())
291
293
if err := popts .Parse (vu .Context (), opts ); err != nil {
292
- return fmt .Errorf ("parsing element tap options: %w" , err )
294
+ return nil , fmt .Errorf ("parsing element tap options: %w" , err )
293
295
}
294
- return eh .Tap (popts ) //nolint:wrapcheck
296
+ return k6ext .Promise (vu .Context (), func () (any , error ) {
297
+ return nil , eh .Tap (popts ) //nolint:wrapcheck
298
+ }), nil
295
299
},
296
300
"textContent" : eh .TextContent ,
297
301
"type" : eh .Type ,
@@ -442,12 +446,14 @@ func mapFrame(vu moduleVU, f *common.Frame) mapping {
442
446
"selectOption" : f .SelectOption ,
443
447
"setContent" : f .SetContent ,
444
448
"setInputFiles" : f .SetInputFiles ,
445
- "tap" : func (selector string , opts goja.Value ) error {
449
+ "tap" : func (selector string , opts goja.Value ) ( * goja. Promise , error ) {
446
450
popts := common .NewFrameTapOptions (f .Timeout ())
447
451
if err := popts .Parse (vu .Context (), opts ); err != nil {
448
- return fmt .Errorf ("parsing frame tap options: %w" , err )
452
+ return nil , fmt .Errorf ("parsing frame tap options: %w" , err )
449
453
}
450
- return f .Tap (selector , popts ) //nolint:wrapcheck
454
+ return k6ext .Promise (vu .Context (), func () (any , error ) {
455
+ return nil , f .Tap (selector , popts ) //nolint:wrapcheck
456
+ }), nil
451
457
},
452
458
"textContent" : f .TextContent ,
453
459
"title" : f .Title ,
@@ -690,12 +696,14 @@ func mapPage(vu moduleVU, p *common.Page) mapping {
690
696
"setExtraHTTPHeaders" : p .SetExtraHTTPHeaders ,
691
697
"setInputFiles" : p .SetInputFiles ,
692
698
"setViewportSize" : p .SetViewportSize ,
693
- "tap" : func (selector string , opts goja.Value ) error {
699
+ "tap" : func (selector string , opts goja.Value ) ( * goja. Promise , error ) {
694
700
popts := common .NewFrameTapOptions (p .Timeout ())
695
701
if err := popts .Parse (vu .Context (), opts ); err != nil {
696
- return fmt .Errorf ("parsing page tap options: %w" , err )
702
+ return nil , fmt .Errorf ("parsing page tap options: %w" , err )
697
703
}
698
- return p .Tap (selector , popts ) //nolint:wrapcheck
704
+ return k6ext .Promise (vu .Context (), func () (any , error ) {
705
+ return nil , p .Tap (selector , popts ) //nolint:wrapcheck
706
+ }), nil
699
707
},
700
708
"textContent" : p .TextContent ,
701
709
"throttleCPU" : p .ThrottleCPU ,
0 commit comments