Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not expose browser.on() #919

Merged
merged 2 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions browser/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,6 @@ func mapBrowser(vu moduleVU, wsURL string, isRemoteBrowser bool) mapping { //nol
}
return b.IsConnected(), nil
},
"on": func(event string) *goja.Promise {
return k6ext.Promise(vu.Context(), func() (result any, reason error) {
b, err := getOrInitBrowser(ctx, bt, vu, wsURL, isRemoteBrowser)
if err != nil {
return nil, err
}
return b.On(event) //nolint:wrapcheck
})
},
"newContext": func(opts goja.Value) (*goja.Object, error) {
b, err := getOrInitBrowser(ctx, bt, vu, wsURL, isRemoteBrowser)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions browser/mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func customMappings() map[string]string {
"Frame.loaderID": "",
"JSHandle.objectID": "",
"Browser.close": "",
// TODO: browser.on method is unexposed until more event
// types other than 'disconnect' are supported.
// See: https://github.com/grafana/xk6-browser/issues/913
"Browser.on": "",
}
}

Expand Down
54 changes: 0 additions & 54 deletions examples/browser_on.js

This file was deleted.