-
Notifications
You must be signed in to change notification settings - Fork 410
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
Add NewSeleniumServiceV4
to support cli args for selenium version 4
#275
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -194,6 +194,37 @@ func NewSeleniumService(jarPath string, port int, opts ...ServiceOption) (*Servi | |||||||||||||||
return s, nil | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
func NewSeleniumServiceV4(jarPath string, port int, opts ...ServiceOption) (*Service, error) { | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. selenium_test.go needs to be updated to test Selenium v4: Line 22 in e9100b7
Line 131 in e9100b7
Line 161 in e9100b7
Line 196 in e9100b7
Line 227 in e9100b7
Line 284 in e9100b7
We should also add Selenium v4 to be automatically downloaded by vendor/init.go: Line 63 in e9100b7
|
||||||||||||||||
s, err := newService(exec.Command("java"), "/wd/hub", port, opts...) | ||||||||||||||||
if err != nil { | ||||||||||||||||
return nil, err | ||||||||||||||||
} | ||||||||||||||||
s.cmd.Args = append(s.cmd.Args, "-jar", jarPath) | ||||||||||||||||
if s.javaPath != "" { | ||||||||||||||||
s.cmd.Path = s.javaPath | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
var classpath []string | ||||||||||||||||
if s.htmlUnitPath != "" { | ||||||||||||||||
classpath = append(classpath, s.htmlUnitPath) | ||||||||||||||||
} | ||||||||||||||||
if s.geckoDriverPath != "" { | ||||||||||||||||
classpath = append(classpath, s.geckoDriverPath) | ||||||||||||||||
} | ||||||||||||||||
if s.chromeDriverPath != "" { | ||||||||||||||||
classpath = append(classpath, s.chromeDriverPath) | ||||||||||||||||
} | ||||||||||||||||
if len(classpath) > 0 { | ||||||||||||||||
s.cmd.Args = append(s.cmd.Args, "--ext", strings.Join(classpath, ":")) | ||||||||||||||||
} | ||||||||||||||||
s.cmd.Args = append(s.cmd.Args, "standalone", "--port", strconv.Itoa(port)) | ||||||||||||||||
if err := s.start(port); err != nil { | ||||||||||||||||
return nil, err | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
return s, nil | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
// NewChromeDriverService starts a ChromeDriver instance in the background. | ||||||||||||||||
func NewChromeDriverService(path string, port int, opts ...ServiceOption) (*Service, error) { | ||||||||||||||||
cmd := exec.Command(path, "--port="+strconv.Itoa(port), "--url-base=wd/hub", "--verbose") | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a documentation comment.
https://github.com/golang/go/wiki/CodeReviewComments#doc-comments