@@ -5,14 +5,16 @@ import * as start from '../cmds/start';
5
5
import * as status from '../cmds/status' ;
6
6
import * as update from '../cmds/update' ;
7
7
8
- const CHROME = 'chrome' ;
9
- const chromeOption : yargs . Options = {
8
+ const CHROMEDRIVER_ALIAS = 'chrome' ;
9
+ const CHROMEDRIVER = 'chromedriver' ;
10
+ const chromedriverOption : yargs . Options = {
10
11
describe : 'Install or update chromedriver.' ,
11
12
default : true ,
12
13
type : 'boolean'
13
14
} ;
14
- const CHROME_LOGS = 'chrome_logs' ;
15
- const chromeLogsOption : yargs . Options = {
15
+ const CHROMEDRIVER_LOGS_ALIAS = 'chrome_logs' ;
16
+ const CHROMEDRIVER_LOGS = 'chromedriver_logs' ;
17
+ const chromedriverLogsOption : yargs . Options = {
16
18
describe : 'File path to chrome logs.' ,
17
19
type : 'string'
18
20
} ;
@@ -30,8 +32,9 @@ const edgeOption: yargs.Options = {
30
32
'"C:\Program Files (x86)\Microsoft Web Driver\MirosoftWebDriver.exe"' ,
31
33
type : 'string'
32
34
} ;
33
- const GECKO = 'gecko' ;
34
- const geckoOption : yargs . Options = {
35
+ const GECKODRIVER_ALIAS = 'gecko' ;
36
+ const GECKODRIVER = 'geckodriver' ;
37
+ const geckodriverOption : yargs . Options = {
35
38
describe : 'Install or update geckodriver.' ,
36
39
default : true ,
37
40
type : 'boolean'
@@ -41,8 +44,9 @@ const githubTokenOption: yargs.Options = {
41
44
describe : 'Use a GitHub token to prevent rate limit issues.' ,
42
45
type : 'string'
43
46
} ;
47
+ const IEDRIVER_ALIAS = 'ie' ;
44
48
const IEDRIVER = 'iedriver' ;
45
- const ieOption : yargs . Options = {
49
+ const iedriverOption : yargs . Options = {
46
50
describe : 'Install or update ie driver.' ,
47
51
default : false ,
48
52
type : 'boolean'
@@ -58,6 +62,31 @@ const logLevelOption: yargs.Options = {
58
62
default : 'info' ,
59
63
type : 'string'
60
64
} ;
65
+ const MAX_VERSIONS_CHROMEDRIVER_ALIAS = 'max_versions.chrome' ;
66
+ const MAX_VERSIONS_CHROMEDRIVER = 'max_versions.chromedriver' ;
67
+ const maxVersionsChromedriverOption : yargs . Options = {
68
+ describe : 'The chromedriver max version used only for update.' ,
69
+ type : 'string'
70
+ } ;
71
+ const MAX_VERSIONS_GECKODRIVER_ALIAS = 'max_versions.gecko' ;
72
+ const MAX_VERSIONS_GECKODRIVER = 'max_versions.geckodriver' ;
73
+ const maxVersionsGeckodriverOption : yargs . Options = {
74
+ describe : 'The geckodriver max version used only for update.' ,
75
+ type : 'string'
76
+ } ;
77
+ const MAX_VERSIONS_IEDRIVER_ALIAS = 'max_versions.ie' ;
78
+ const MAX_VERSIONS_IEDRIVER = 'max_versions.iedriver' ;
79
+ const maxVersionsIedriverOption : yargs . Options = {
80
+ describe : 'The ie driver max version used only for update.' ,
81
+ type : 'string'
82
+ } ;
83
+ const MAX_VERSIONS_SELENIUM_ALIAS = 'max_versions.standalone' ;
84
+ const MAX_VERSIONS_SELENIUM = 'max_versions.selenium' ;
85
+ const maxVersionsSeleniumOption : yargs . Options = {
86
+ describe : 'The selenium server standalone max version used only for update.' ,
87
+ type : 'string'
88
+ } ;
89
+
61
90
const OUT_DIR = 'out_dir' ;
62
91
const outDirOption : yargs . Options = {
63
92
describe : 'Location of output.' ,
@@ -79,34 +108,40 @@ const seleniumLogLevelOption: yargs.Options = {
79
108
describe : 'Set the -Dselenium.LOGGER.level flag when starting the server' ,
80
109
type : 'string'
81
110
} ;
82
- const STANDALONE = 'standalone' ;
83
- const standaloneOption : yargs . Options = {
111
+ const SELENIUM_ALIAS = 'standalone' ;
112
+ const SELENIUM = 'selenium' ;
113
+ const seleniumOption : yargs . Options = {
84
114
describe : 'Install or update selenium server standalone.' ,
85
115
default : true ,
86
116
type : 'boolean'
87
117
} ;
88
- const STANDALONE_NODE = 'standalone_node' ;
89
- const standaloneNodeOption : yargs . Options = {
118
+ const SELENIUM_NODE_ALIAS = 'standalone_node' ;
119
+ const SELENIUM_NODE = 'selenium_node' ;
120
+ const seleniumNodeOption : yargs . Options = {
90
121
describe : 'Start the selenium server standalone with role set to "node".' ,
91
122
type : 'boolean'
92
123
} ;
93
- const VERSIONS_CHROME = 'versions.chrome' ;
94
- const versionsChromeOption : yargs . Options = {
124
+ const VERSIONS_CHROMEDRIVER_ALIAS = 'versions.chrome' ;
125
+ const VERSIONS_CHROMEDRIVER = 'versions.chromedriver' ;
126
+ const versionsChromedriverOption : yargs . Options = {
95
127
describe : 'The chromedriver version.' ,
96
128
type : 'string'
97
129
} ;
98
- const VERSIONS_GECKO = 'versions.gecko' ;
99
- const versionsGeckoOption : yargs . Options = {
130
+ const VERSIONS_GECKODRIVER_ALIAS = 'versions.gecko' ;
131
+ const VERSIONS_GECKODRIVER = 'versions.geckodriver' ;
132
+ const versionsGeckodriverOption : yargs . Options = {
100
133
describe : 'The geckodriver version.' ,
101
134
type : 'string'
102
135
} ;
103
- const VERSIONS_IE = 'versions.ie' ;
104
- const versionsIeOption : yargs . Options = {
136
+ const VERSIONS_IEDRIVER_ALIAS = 'versions.ie' ;
137
+ const VERSIONS_IEDRIVER = 'versions.iedriver' ;
138
+ const versionsIedriverOption : yargs . Options = {
105
139
describe : 'The ie driver version.' ,
106
140
type : 'string'
107
141
} ;
108
- const VERSIONS_STANDALONE = 'versions.standalone' ;
109
- const versionsStandaloneOption : yargs . Options = {
142
+ const VERSIONS_SELENIUM_ALIAS = 'versions.standalone' ;
143
+ const VERSIONS_SELENIUM = 'versions.selenium' ;
144
+ const versionsSeleniumOption : yargs . Options = {
110
145
describe : 'The selenium server standalone version.' ,
111
146
type : 'string'
112
147
} ;
@@ -133,22 +168,33 @@ yargs
133
168
. command (
134
169
'start' , 'Start up the selenium server.' ,
135
170
( yargs : yargs . Argv ) => {
136
- return yargs . option ( CHROME , chromeOption )
137
- . option ( CHROME_LOGS , chromeLogsOption )
171
+ return yargs
172
+ . option ( CHROMEDRIVER , chromedriverOption )
173
+ . alias ( CHROMEDRIVER_ALIAS , CHROMEDRIVER )
174
+ . option ( CHROMEDRIVER_LOGS , chromedriverLogsOption )
175
+ . alias ( CHROMEDRIVER_LOGS_ALIAS , CHROMEDRIVER_LOGS )
138
176
. option ( DETACH , detachOption )
139
177
. option ( EDGE , edgeOption )
140
- . option ( GECKO , geckoOption )
141
- . option ( IEDRIVER , ieOption )
178
+ . option ( GECKODRIVER , geckodriverOption )
179
+ . alias ( GECKODRIVER_ALIAS , GECKODRIVER )
180
+ . option ( IEDRIVER , iedriverOption )
181
+ . alias ( IEDRIVER_ALIAS , IEDRIVER )
142
182
. option ( LOG_LEVEL , logLevelOption )
143
183
. option ( OUT_DIR , outDirOption )
144
- . option ( SELENIUM_PORT , seleniumPort )
184
+ . option ( SELENIUM , seleniumOption )
185
+ . alias ( SELENIUM_ALIAS , SELENIUM )
145
186
. option ( SELENIUM_LOG_LEVEL , seleniumLogLevelOption )
146
- . option ( STANDALONE , standaloneOption )
147
- . option ( STANDALONE_NODE , standaloneNodeOption )
148
- . option ( VERSIONS_CHROME , versionsChromeOption )
149
- . option ( VERSIONS_GECKO , versionsGeckoOption )
150
- . option ( VERSIONS_IE , versionsIeOption )
151
- . option ( VERSIONS_STANDALONE , versionsStandaloneOption ) ;
187
+ . option ( SELENIUM_NODE , seleniumNodeOption )
188
+ . alias ( SELENIUM_NODE_ALIAS , SELENIUM_NODE )
189
+ . option ( SELENIUM_PORT , seleniumPort )
190
+ . option ( VERSIONS_CHROMEDRIVER , versionsChromedriverOption )
191
+ . alias ( VERSIONS_CHROMEDRIVER_ALIAS , VERSIONS_CHROMEDRIVER )
192
+ . option ( VERSIONS_GECKODRIVER , versionsGeckodriverOption )
193
+ . alias ( VERSIONS_GECKODRIVER_ALIAS , VERSIONS_GECKODRIVER )
194
+ . option ( VERSIONS_IEDRIVER , versionsIedriverOption )
195
+ . alias ( VERSIONS_IEDRIVER_ALIAS , VERSIONS_IEDRIVER )
196
+ . option ( VERSIONS_SELENIUM , versionsSeleniumOption )
197
+ . alias ( VERSIONS_SELENIUM_ALIAS , VERSIONS_SELENIUM ) ;
152
198
} ,
153
199
( argv : yargs . Arguments ) => {
154
200
start . handler ( argv ) ;
@@ -166,19 +212,34 @@ yargs
166
212
'update' , 'Install or update selected binaries.' ,
167
213
( yargs : yargs . Argv ) => {
168
214
return yargs . option ( OUT_DIR , outDirOption )
169
- . option ( CHROME , chromeOption )
170
- . option ( GECKO , geckoOption )
215
+ . option ( CHROMEDRIVER , chromedriverOption )
216
+ . alias ( CHROMEDRIVER_ALIAS , CHROMEDRIVER )
217
+ . option ( GECKODRIVER , geckodriverOption )
218
+ . alias ( GECKODRIVER_ALIAS , GECKODRIVER )
171
219
. option ( GITHUB_TOKEN , githubTokenOption )
172
- . option ( IEDRIVER , ieOption )
220
+ . option ( IEDRIVER , iedriverOption )
221
+ . alias ( IEDRIVER_ALIAS , IEDRIVER )
173
222
. option ( IGNORE_SSL , ignoreSSLOption )
174
223
. option ( LOG_LEVEL , logLevelOption )
224
+ . option ( MAX_VERSIONS_CHROMEDRIVER , maxVersionsChromedriverOption )
225
+ . alias ( MAX_VERSIONS_CHROMEDRIVER_ALIAS , MAX_VERSIONS_CHROMEDRIVER )
226
+ . option ( MAX_VERSIONS_GECKODRIVER , maxVersionsGeckodriverOption )
227
+ . alias ( MAX_VERSIONS_GECKODRIVER_ALIAS , MAX_VERSIONS_GECKODRIVER )
228
+ . option ( MAX_VERSIONS_IEDRIVER , maxVersionsIedriverOption )
229
+ . alias ( MAX_VERSIONS_IEDRIVER_ALIAS , MAX_VERSIONS_IEDRIVER )
230
+ . option ( MAX_VERSIONS_SELENIUM , maxVersionsSeleniumOption )
175
231
. option ( OUT_DIR , outDirOption )
176
232
. option ( PROXY , proxyOption )
177
- . option ( STANDALONE , standaloneOption )
178
- . option ( VERSIONS_CHROME , versionsChromeOption )
179
- . option ( VERSIONS_GECKO , versionsGeckoOption )
180
- . option ( VERSIONS_IE , versionsIeOption )
181
- . option ( VERSIONS_STANDALONE , versionsStandaloneOption ) ;
233
+ . option ( SELENIUM , seleniumOption )
234
+ . alias ( SELENIUM_ALIAS , SELENIUM )
235
+ . option ( VERSIONS_CHROMEDRIVER , versionsChromedriverOption )
236
+ . alias ( VERSIONS_CHROMEDRIVER_ALIAS , VERSIONS_CHROMEDRIVER )
237
+ . option ( VERSIONS_GECKODRIVER , versionsGeckodriverOption )
238
+ . alias ( VERSIONS_GECKODRIVER_ALIAS , VERSIONS_GECKODRIVER )
239
+ . option ( VERSIONS_IEDRIVER , versionsIedriverOption )
240
+ . alias ( VERSIONS_IEDRIVER_ALIAS , VERSIONS_IEDRIVER )
241
+ . option ( VERSIONS_SELENIUM , versionsSeleniumOption )
242
+ . alias ( VERSIONS_SELENIUM_ALIAS , VERSIONS_SELENIUM ) ;
182
243
} ,
183
244
( argv : yargs . Arguments ) => {
184
245
update . handler ( argv ) ;
0 commit comments