Skip to content

Commit 786b3cd

Browse files
committed
Add console script to download the selenium server jar file
1 parent 3460dbd commit 786b3cd

File tree

1 file changed

+27
-0
lines changed
  • seleniumbase/console_scripts

1 file changed

+27
-0
lines changed

seleniumbase/console_scripts/run.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
seleniumbase install chromedriver
99
seleniumbase mkdir browser_tests
1010
seleniumbase convert my_old_webdriver_unittest.py
11+
seleniumbase download server
1112
seleniumbase grid-hub start
1213
seleniumbase grid-node start --hub=127.0.0.1
1314
"""
1415

1516
import sys
1617
from seleniumbase.console_scripts import sb_mkdir
1718
from seleniumbase.console_scripts import sb_install
19+
from seleniumbase.utilities.selenium_grid import download_selenium_server
1820
from seleniumbase.utilities.selenium_grid import grid_hub
1921
from seleniumbase.utilities.selenium_grid import grid_node
2022
from seleniumbase.utilities.selenium_ide import convert_ide
@@ -91,6 +93,20 @@ def show_convert_usage():
9193
print("")
9294

9395

96+
def show_download_usage():
97+
print(" ** download **")
98+
print("")
99+
print(" Usage:")
100+
print(" seleniumbase download [ITEM]")
101+
print(" (Options: server")
102+
print(" Example:")
103+
print(" seleniumbase download server")
104+
print(" Output:")
105+
print(" Downloads the specified item.")
106+
print(" (server is required for using your own Selenium Grid)")
107+
print("")
108+
109+
94110
def show_grid_hub_usage():
95111
print(" ** grid-hub **")
96112
print("")
@@ -132,6 +148,7 @@ def show_detailed_help():
132148
show_install_usage()
133149
show_mkdir_usage()
134150
show_convert_usage()
151+
show_download_usage()
135152
show_grid_hub_usage()
136153
show_grid_node_usage()
137154

@@ -169,6 +186,12 @@ def main():
169186
else:
170187
show_basic_usage()
171188
show_mkdir_usage()
189+
elif command == "download":
190+
if len(command_args) >= 1:
191+
download_selenium_server.main(force_download=True)
192+
else:
193+
show_basic_usage()
194+
show_download_usage()
172195
elif command == "grid-hub":
173196
if len(command_args) >= 1:
174197
grid_hub.main()
@@ -195,6 +218,10 @@ def main():
195218
print("")
196219
show_convert_usage()
197220
return
221+
elif command_args[0] == "download":
222+
print("")
223+
show_download_usage()
224+
return
198225
elif command_args[0] == "grid-hub":
199226
print("")
200227
show_grid_hub_usage()

0 commit comments

Comments
 (0)