This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 2 files changed +18
-5
lines changed
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ exports.config = {
38
38
// seleniumArgs: ['-browserTimeout=60']
39
39
// Ignored if seleniumServerJar is null.
40
40
seleniumArgs : [ ] ,
41
+ // Can be an object which will be passed to the SeleniumServer class as args.
42
+ // If you specify `args` or `port` in this object, it will overwrite the values
43
+ // set via `seleniumPort` and `seleniumArgs`.
44
+ localSeleniumStandaloneOpts : null ,
41
45
// ChromeDriver location is used to help find the chromedriver binary.
42
46
// This will be passed to the Selenium jar as the system property
43
47
// webdriver.chrome.driver. If null, Selenium will
Original file line number Diff line number Diff line change @@ -72,15 +72,24 @@ LocalDriverProvider.prototype.setupEnv = function() {
72
72
73
73
log . puts ( 'Starting selenium standalone server...' ) ;
74
74
75
+ var serverConf = this . config_ . localSeleniumStandaloneOpts || { } ;
76
+
77
+ // If args or port is not set use seleniumArgs and seleniumPort
78
+ // for backward compatibility
79
+ if ( serverConf . args === undefined ) {
80
+ serverConf . args = this . config_ . seleniumArgs || [ ] ;
81
+ }
82
+ if ( serverConf . port === undefined ) {
83
+ serverConf . port = this . config_ . seleniumPort ;
84
+ }
85
+
75
86
// configure server
76
87
if ( this . config_ . chromeDriver ) {
77
- this . config_ . seleniumArgs . push ( '-Dwebdriver.chrome.driver=' +
88
+ serverConf . args . push ( '-Dwebdriver.chrome.driver=' +
78
89
this . config_ . chromeDriver ) ;
79
90
}
80
- this . server_ = new remote . SeleniumServer ( this . config_ . seleniumServerJar , {
81
- args : this . config_ . seleniumArgs ,
82
- port : this . config_ . seleniumPort
83
- } ) ;
91
+
92
+ this . server_ = new remote . SeleniumServer ( this . config_ . seleniumServerJar , serverConf ) ;
84
93
85
94
//start local server, grab hosted address, and resolve promise
86
95
this . server_ . start ( ) . then ( function ( url ) {
You can’t perform that action at this time.
0 commit comments