Skip to content

Commit

Permalink
Update the mapping to work with remoteRegistry
Browse files Browse the repository at this point in the history
Now that the remoteRegistry is part of the ModuleInstance, we can
retrieve the parsed data from the env var and use it when setting up
the mapping for the current vu.
  • Loading branch information
ankur22 committed May 18, 2023
1 parent 22249a3 commit b64e8b1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions browser/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import (
"context"
"errors"
"fmt"
"os"

"github.com/dop251/goja"

"github.com/grafana/xk6-browser/api"
"github.com/grafana/xk6-browser/chromium"
"github.com/grafana/xk6-browser/env"
"github.com/grafana/xk6-browser/k6error"
"github.com/grafana/xk6-browser/k6ext"

Expand All @@ -37,7 +35,7 @@ func mapBrowserToGoja(vu moduleVU) *goja.Object {
obj = rt.NewObject()
// TODO: Use k6 LookupEnv instead of OS package methods.
// See https://github.com/grafana/xk6-browser/issues/822.
wsURL, isRemoteBrowser = env.IsRemoteBrowser(os.LookupEnv)
wsURL, isRemoteBrowser = vu.remoteRegistry.IsRemoteBrowser()
browserType = chromium.NewBrowserType(vu)
)
for k, v := range mapBrowserType(vu, browserType, wsURL, isRemoteBrowser) {
Expand Down

0 comments on commit b64e8b1

Please sign in to comment.