Skip to content

Commit 08ba505

Browse files
authored
Merge pull request #253 from seleniumbase/selenium-grid-updates
Update seleniumbase console scripts
2 parents f10cf97 + 9d83517 commit 08ba505

File tree

7 files changed

+56
-10
lines changed

7 files changed

+56
-10
lines changed

seleniumbase/console_scripts/ReadMe.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ file name while keeping the original file intact.
4949
Works with Katalon Recorder scripts.
5050
See: http://www.katalon.com/automation-recorder
5151

52+
### download
53+
54+
* Usage:
55+
``seleniumbase download [ITEM]``
56+
(Options: server)
57+
58+
* Example:
59+
``seleniumbase download server``
60+
61+
* Output:
62+
Downloads the specified item.
63+
(server is required for using your own Selenium Grid)
64+
5265
### grid-hub
5366

5467
* Usage:

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()

seleniumbase/utilities/selenium_grid/ReadMe.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ The Selenium Grid Hub lets you distribute tests to run in parallel across multip
44

55
### Running the Selenium Grid Hub
66

7-
The following commands will work once you've installed seleniumbase, which comes with the seleniumbase console scripts interface.
7+
The following commands will work once you've installed seleniumbase.
88

9-
Grid Hub server controls:
9+
#### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Downloading the Selenium Server JAR file:
10+
```
11+
seleniumbase download server
12+
```
13+
* (Required for using your own Selenium Grid)
14+
15+
#### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Grid Hub server controls:
1016
```
1117
seleniumbase grid-hub {start|stop|restart} [OPTIONS]
1218
```
1319
Options:
1420
* ``-v``, ``--verbose`` (Increases verbosity of logging output.)
1521

16-
Grid node server controlls:
22+
#### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Grid node server controls:
1723
```
1824
seleniumbase grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]
1925
```

seleniumbase/utilities/selenium_grid/download_selenium_server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from urllib.request import urlopen
99

1010
SELENIUM_JAR = ("http://selenium-release.storage.googleapis.com"
11-
"/3.14/selenium-server-standalone-3.14.0.jar")
12-
JAR_FILE = "selenium-server-standalone-3.14.0.jar"
11+
"/3.141/selenium-server-standalone-3.141.59.jar")
12+
JAR_FILE = "selenium-server-standalone-3.141.59.jar"
1313
RENAMED_JAR_FILE = "selenium-server-standalone.jar"
1414

1515
dir_path = os.path.dirname(os.path.realpath(__file__))
@@ -39,8 +39,8 @@ def is_available_locally():
3939
return os.path.isfile(FULL_EXPECTED_PATH)
4040

4141

42-
def main():
43-
if not is_available_locally():
42+
def main(force_download=True):
43+
if force_download or not is_available_locally():
4444
download_selenium_server()
4545
for filename in os.listdir("."):
4646
# If multiple copies exist, keep only the latest and rename it.

seleniumbase/utilities/selenium_grid/grid_hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def main():
5050
file.close()
5151

5252
from seleniumbase.utilities.selenium_grid import download_selenium_server
53-
download_selenium_server.main() # Nothing happens if already exists
53+
download_selenium_server.main(force_download=False) # Only runs if needed
5454

5555
if "linux" in sys.platform or "darwin" in sys.platform:
5656
if grid_hub_command == "start":

seleniumbase/utilities/selenium_grid/grid_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def main():
6161
file.close()
6262

6363
from seleniumbase.utilities.selenium_grid import download_selenium_server
64-
download_selenium_server.main() # Nothing happens if already exists
64+
download_selenium_server.main(force_download=False) # Only runs if needed
6565

6666
if "linux" in sys.platform or "darwin" in sys.platform:
6767
if grid_hub_command == "start":

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.17.9',
20+
version='1.17.10',
2121
description='All-in-One Test Automation Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)