Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 300856e

Browse files
committedJul 31, 2018
Update the console scripts runner
1 parent e735482 commit 300856e

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed
 

‎console_scripts/run.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
seleniumbase [COMMAND] [PARAMETERS]
66
77
Examples:
8-
seleniumbase mkdir [DIRECTORY_NAME]
9-
seleniumbase convert [PYTHON_WEBDRIVER_UNITTEST_FILE]
8+
seleniumbase install chromedriver
9+
seleniumbase mkdir gui_tests
10+
seleniumbase convert my_old_webdriver_unittest.py
1011
seleniumbase grid-hub start
1112
seleniumbase grid-node start --hub=127.0.0.1
1213
"""
1314

1415
import sys
1516
from console_scripts import sb_mkdir
17+
from console_scripts import sb_install
1618
from integrations.selenium_grid import grid_hub
1719
from integrations.selenium_grid import grid_node
1820
from integrations.selenium_ide import convert_ide
@@ -32,18 +34,37 @@ def show_basic_usage():
3234
print("")
3335
print("Commands:")
3436
print("")
37+
print(" install [DRIVER_NAME]")
3538
print(" mkdir [NEW_TEST_DIRECTORY_NAME]")
3639
print(" convert [PYTHON_WEBDRIVER_UNITTEST_FILE]")
3740
print(" grid-hub {start|stop|restart} [OPTIONS]")
3841
print(" grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]")
3942
print("")
4043

4144

45+
def show_install_usage():
46+
print(" ** install **")
47+
print("")
48+
print(" Usage:")
49+
print(" seleniumbase install [DRIVER_NAME]")
50+
print(" (Drivers: chromedriver, geckodriver, edgedriver)")
51+
print(" Example:")
52+
print(" seleniumbase install chromedriver")
53+
print(" Output:")
54+
print(" Installs the specified webdriver.")
55+
print(" (chromedriver is required for Chrome automation)")
56+
print(" (geckodriver is required for Firefox automation)")
57+
print(" (edgedriver is required for MS Edge automation)")
58+
print("")
59+
60+
4261
def show_mkdir_usage():
4362
print(" ** mkdir **")
4463
print("")
4564
print(" Usage:")
4665
print(" seleniumbase mkdir [DIRECTORY_NAME]")
66+
print(" Example:")
67+
print(" seleniumbase mkdir gui_tests")
4768
print(" Output:")
4869
print(" Creates a new folder for running SeleniumBase scripts.")
4970
print(" The new folder contains default config files,")
@@ -105,6 +126,7 @@ def show_detailed_help():
105126
show_basic_usage()
106127
print("More Info:")
107128
print("")
129+
show_install_usage()
108130
show_mkdir_usage()
109131
show_convert_usage()
110132
show_grid_hub_usage()
@@ -123,14 +145,20 @@ def main():
123145
command = sys.argv[1]
124146
command_args = sys.argv[2:]
125147

126-
if command == "convert":
148+
if command == "install":
149+
if len(command_args) >= 1:
150+
sb_install.main()
151+
else:
152+
show_basic_usage()
153+
show_install_usage()
154+
elif command == "convert":
127155
if len(command_args) == 1:
128156
convert_ide.main()
129157
else:
130158
show_basic_usage()
131159
show_convert_usage()
132160
elif command == "mkdir":
133-
if len(command_args) == 1:
161+
if len(command_args) >= 1:
134162
sb_mkdir.main()
135163
else:
136164
show_basic_usage()
@@ -149,7 +177,11 @@ def main():
149177
show_grid_node_usage()
150178
elif command == "help" or command == "--help":
151179
if len(command_args) >= 1:
152-
if command_args[0] == "mkdir":
180+
if command_args[0] == "install":
181+
print("")
182+
show_install_usage()
183+
return
184+
elif command_args[0] == "mkdir":
153185
print("")
154186
show_mkdir_usage()
155187
return

0 commit comments

Comments
 (0)