Skip to content

Commit

Permalink
Remove browser module Version
Browse files Browse the repository at this point in the history
We forgot to remove the exported field after the following change:
710e616
  • Loading branch information
inancgumus committed Jun 7, 2023
1 parent 2d4ba2f commit afd1811
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion api/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ type Browser interface {
NewPage(opts goja.Value) (Page, error)
On(string) (bool, error)
UserAgent() string
Version() string
}
7 changes: 0 additions & 7 deletions browser/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,13 +716,6 @@ func mapBrowser(vu moduleVU, wsURL string, isRemoteBrowser bool) mapping { //nol
}
return b.UserAgent(), nil
},
"version": func() (string, error) {
b, err := getOrInitBrowser(ctx, bt, vu, wsURL, isRemoteBrowser)
if err != nil {
return "", err
}
return b.Version(), nil
},
"newPage": func(opts goja.Value) (mapping, error) {
b, err := getOrInitBrowser(ctx, bt, vu, wsURL, isRemoteBrowser)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion browser/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type (
JSModule struct {
Browser *goja.Object
Devices map[string]common.Device
Version string
}

// ModuleInstance represents an instance of the JS module.
Expand Down
9 changes: 0 additions & 9 deletions tests/browser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"syscall"
Expand Down Expand Up @@ -115,14 +114,6 @@ func TestBrowserOn(t *testing.T) {
})
}

// This only works for Chrome!
func TestBrowserVersion(t *testing.T) {
const re = `^\d+\.\d+\.\d+\.\d+$`
r, _ := regexp.Compile(re)
ver := newTestBrowser(t).Version()
assert.Regexp(t, r, ver, "expected browser version to match regex %q, but found %q", re, ver)
}

// This only works for Chrome!
// TODO: Improve this test, see:
// https://github.com/grafana/xk6-browser/pull/51#discussion_r742696736
Expand Down

0 comments on commit afd1811

Please sign in to comment.