File tree 2 files changed +13
-3
lines changed
selenium/webdriver/remote
test/unit/selenium/webdriver/remote
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 27
27
28
28
29
29
class Server :
30
- """Manage the Selenium Remote (Grid ) Server.
30
+ """Manage a Selenium Grid (Remote ) Server in standalone mode .
31
31
32
- Selenium Manager will detect the server location and download it if necessary, unless an existing server path is specified.
32
+ This class contains functionality for downloading the server and starting/stopping it.
33
+
34
+ For more information on Selenium Grid, see:
35
+ - https://www.selenium.dev/documentation/grid/getting_started/
33
36
34
37
Parameters:
35
38
-----------
@@ -89,8 +92,11 @@ def _wait_for_server(self, timeout=10):
89
92
return False
90
93
91
94
def start (self ):
92
- """Start the server."""
95
+ """Start the server.
93
96
97
+ Selenium Manager will detect the server location and download it if necessary,
98
+ unless an existing server path was specified.
99
+ """
94
100
if self .path is None :
95
101
selenium_manager = SeleniumManager ()
96
102
args = ["--grid" ]
Original file line number Diff line number Diff line change @@ -28,23 +28,27 @@ def test_server_with_bad_path():
28
28
with pytest .raises (OSError , match = re .escape (msg )):
29
29
Server (path = path )
30
30
31
+
31
32
def test_server_with_invalid_version ():
32
33
versions = ("0.0" , "invalid" )
33
34
for version in versions :
34
35
msg = f"Server.__init__() got an invalid version: '{ version } '"
35
36
with pytest .raises (TypeError , match = re .escape (msg )):
36
37
Server (version = version )
37
38
39
+
38
40
def test_server_with_invalid_port ():
39
41
port = "invalid"
40
42
msg = f"Server.__init__() got an invalid port: '{ port } '"
41
43
with pytest .raises (TypeError , match = re .escape (msg )):
42
44
Server (port = port )
43
45
46
+
44
47
def test_server_with_port_out_of_range ():
45
48
with pytest .raises (ValueError , match = "port must be 0-65535" ):
46
49
Server (port = 99999 )
47
50
51
+
48
52
def test_stopping_server_thats_not_running ():
49
53
server = Server ()
50
54
with pytest .raises (RuntimeError , match = "Selenium server isn't running" ):
You can’t perform that action at this time.
0 commit comments