diff --git a/browser/mapping.go b/browser/mapping.go index 0ff22b55e..9697af4ce 100644 --- a/browser/mapping.go +++ b/browser/mapping.go @@ -789,9 +789,13 @@ func mapPage(vu moduleVU, p *common.Page) mapping { } // mapTouchscreen to the JS module. -func mapTouchscreen(_ moduleVU, ts *common.Touchscreen) mapping { +func mapTouchscreen(vu moduleVU, ts *common.Touchscreen) mapping { return mapping{ - "tap": ts.Tap, + "tap": func(x float64, y float64) *goja.Promise { + return k6ext.Promise(vu.Context(), func() (result any, reason error) { + return nil, ts.Tap(x, y) //nolint:wrapcheck + }) + }, } } diff --git a/browser/mapping_test.go b/browser/mapping_test.go index 4e3b2e344..316b825b9 100644 --- a/browser/mapping_test.go +++ b/browser/mapping_test.go @@ -527,7 +527,7 @@ type keyboardAPI interface { //nolint: unused // touchscreenAPI is the interface of a touchscreen. type touchscreenAPI interface { - Tap(x float64, y float64) error + Tap(x float64, y float64) *goja.Promise } // mouseAPI is the interface of a mouse input device.