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