Skip to content

Commit d5e4870

Browse files
authored
Merge pull request #1072 from seleniumbase/improve-grid-arg-parsing
Improve arg-parsing for Selenium Grid usage
2 parents 3ddc997 + dfd5ef0 commit d5e4870

File tree

5 files changed

+54
-31
lines changed

5 files changed

+54
-31
lines changed

azure-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
vmImage: 'Ubuntu-20.04'
1212
strategy:
1313
matrix:
14-
Python3.5:
14+
Python3_5:
1515
python.version: '3.5'
16-
Python3.6:
16+
Python3_6:
1717
python.version: '3.6'
18-
Python3.7:
18+
Python3_7:
1919
python.version: '3.7'
20-
Python3.8:
20+
Python3_8:
2121
python.version: '3.8'
22-
Python3.9:
22+
Python3_9:
2323
python.version: '3.9'
2424
maxParallel: 5
2525

requirements.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,19 @@ pip>=20.3.4;python_version<"3.6"
22
pip>=21.3.1;python_version>="3.6"
33
packaging>=20.9;python_version<"3.6"
44
packaging>=21.2;python_version>="3.6"
5-
typing-extensions>=3.10.0.2
65
setuptools>=44.1.1;python_version<"3.5"
76
setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"
8-
setuptools>=58.5.3;python_version>="3.6"
9-
setuptools-scm==5.0.2;python_version<"3.6"
7+
setuptools>=59.1.0;python_version>="3.6"
8+
setuptools-scm>=5.0.2;python_version<"3.6"
109
setuptools-scm>=6.3.2;python_version>="3.6"
1110
tomli>=1.2.2;python_version>="3.6"
1211
wheel>=0.37.0
1312
attrs>=21.2.0
1413
PyYAML>=6.0;python_version>="3.6"
15-
traitlets==4.3.3;python_version<"3.7"
14+
traitlets>=4.3.3;python_version<"3.7"
1615
traitlets>=5.1.1;python_version>="3.7"
1716
certifi>=2021.10.8
18-
sortedcontainers==2.4.0
1917
six==1.16.0
20-
nose==1.3.7
21-
sniffio;python_version>="3.7"
2218
ipdb==0.13.4;python_version<"3.5"
2319
ipdb==0.13.9;python_version>="3.5"
2420
parso==0.7.1;python_version<"3.6"
@@ -34,16 +30,19 @@ urllib3==1.26.7
3430
requests==2.26.0;python_version<"3.5"
3531
requests==2.25.1;python_version>="3.5" and python_version<"3.6"
3632
requests==2.26.0;python_version>="3.6"
37-
selenium==3.141.0;python_version<"3.7"
38-
selenium==4.0.0;python_version>="3.7"
39-
wsproto==1.0.0;python_version>="3.7"
33+
nose==1.3.7
34+
sniffio==1.2.0;python_version>="3.7"
4035
trio==0.19.0;python_version>="3.7"
4136
trio-websocket==0.9.2;python_version>="3.7"
4237
pyopenssl==21.0.0;python_version>="3.7"
38+
wsproto==1.0.0;python_version>="3.7"
39+
selenium==3.141.0;python_version<"3.7"
40+
selenium==4.0.0;python_version>="3.7"
4341
msedge-selenium-tools==3.141.3;python_version<"3.7"
4442
more-itertools==5.0.0;python_version<"3.5"
4543
more-itertools==8.11.0;python_version>="3.5"
4644
cssselect==1.1.0
45+
sortedcontainers==2.4.0
4746
filelock==3.2.1;python_version<"3.6"
4847
filelock==3.3.2;python_version>="3.6"
4948
fasteners==0.16;python_version<"3.5"
@@ -72,7 +71,7 @@ parameterized==0.8.1
7271
sbvirtualdisplay==1.0.0
7372
soupsieve==1.9.6;python_version<"3.5"
7473
soupsieve==2.1;python_version>="3.5" and python_version<"3.6"
75-
soupsieve==2.3;python_version>="3.6"
74+
soupsieve==2.3.1;python_version>="3.6"
7675
beautifulsoup4==4.9.3;python_version<"3.5"
7776
beautifulsoup4==4.10.0;python_version>="3.5"
7877
cryptography==2.9.2;python_version<"3.5"
@@ -108,6 +107,7 @@ toml==0.10.2
108107
Pillow==6.2.2;python_version<"3.5"
109108
Pillow==7.2.0;python_version>="3.5" and python_version<"3.6"
110109
Pillow==8.4.0;python_version>="3.6"
110+
typing-extensions==3.10.0.2;python_version<"3.8"
111111
rich==10.13.0;python_version>="3.6" and python_version<"4.0"
112112
tornado==5.1.1;python_version<"3.5"
113113
tornado==6.1;python_version>="3.5"
@@ -119,7 +119,7 @@ pdfminer.six==20211012;python_version>="3.6"
119119
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)
120120

121121
coverage==5.5;python_version<"3.6"
122-
coverage==6.1.1;python_version>="3.6"
122+
coverage==6.1.2;python_version>="3.6"
123123
pytest-cov==2.12.1;python_version<"3.6"
124124
pytest-cov==3.0.0;python_version>="3.6"
125125
flake8==3.7.9;python_version<"3.5"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "2.1.6"
2+
__version__ = "2.1.7"

seleniumbase/core/browser_launcher.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,31 @@ def get_remote_driver(
876876
device_height,
877877
device_pixel_ratio,
878878
):
879+
# Construct the address for connecting to a Selenium Grid
880+
if servername.startswith("https://"):
881+
protocol = "https"
882+
servername = servername.split("https://")[1]
883+
elif "://" in servername:
884+
servername = servername.split("://")[1]
885+
server_with_port = ""
886+
if ":" not in servername:
887+
col_port = ":" + str(port)
888+
first_slash = servername.find("/")
889+
if first_slash != -1:
890+
server_with_port = (
891+
servername[:first_slash] + col_port + servername[first_slash:]
892+
)
893+
else:
894+
server_with_port = servername + col_port
895+
else:
896+
server_with_port = servername
897+
address = "%s://%s" % (protocol, server_with_port)
898+
if not address.endswith("/wd/hub"):
899+
if address.endswith("/"):
900+
address += "wd/hub"
901+
else:
902+
address += "/wd/hub"
879903
downloads_path = download_helper.get_downloads_folder()
880-
address = "%s://%s:%s/wd/hub" % (protocol, servername, port)
881904
desired_caps = {}
882905
extra_caps = {}
883906
if cap_file:

setup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,19 @@
118118
'pip>=21.3.1;python_version>="3.6"',
119119
'packaging>=20.9;python_version<"3.6"',
120120
'packaging>=21.2;python_version>="3.6"',
121-
"typing-extensions>=3.10.0.2",
122121
'setuptools>=44.1.1;python_version<"3.5"',
123122
'setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"',
124-
'setuptools>=58.5.3;python_version>="3.6"',
125-
'setuptools-scm==5.0.2;python_version<"3.6"',
123+
'setuptools>=59.1.0;python_version>="3.6"',
124+
'setuptools-scm>=5.0.2;python_version<"3.6"',
126125
'setuptools-scm>=6.3.2;python_version>="3.6"',
127126
'tomli>=1.2.2;python_version>="3.6"',
128127
"wheel>=0.37.0",
129128
"attrs>=21.2.0",
130129
'PyYAML>=6.0;python_version>="3.6"',
131-
'traitlets==4.3.3;python_version<"3.7"',
130+
'traitlets>=4.3.3;python_version<"3.7"',
132131
'traitlets>=5.1.1;python_version>="3.7"',
133132
"certifi>=2021.10.8",
134-
"sortedcontainers==2.4.0",
135133
"six==1.16.0",
136-
"nose==1.3.7",
137-
'sniffio;python_version>="3.7"', # For "trio". (Funnier under "nose")
138134
'ipdb==0.13.4;python_version<"3.5"',
139135
'ipdb==0.13.9;python_version>="3.5"',
140136
'parso==0.7.1;python_version<"3.6"',
@@ -150,16 +146,19 @@
150146
'requests==2.26.0;python_version<"3.5"',
151147
'requests==2.25.1;python_version>="3.5" and python_version<"3.6"',
152148
'requests==2.26.0;python_version>="3.6"',
153-
'selenium==3.141.0;python_version<"3.7"',
154-
'selenium==4.0.0;python_version>="3.7"',
155-
'wsproto==1.0.0;python_version>="3.7"',
149+
"nose==1.3.7",
150+
'sniffio==1.2.0;python_version>="3.7"',
156151
'trio==0.19.0;python_version>="3.7"',
157152
'trio-websocket==0.9.2;python_version>="3.7"',
158153
'pyopenssl==21.0.0;python_version>="3.7"',
154+
'wsproto==1.0.0;python_version>="3.7"',
155+
'selenium==3.141.0;python_version<"3.7"',
156+
'selenium==4.0.0;python_version>="3.7"',
159157
'msedge-selenium-tools==3.141.3;python_version<"3.7"',
160158
'more-itertools==5.0.0;python_version<"3.5"',
161159
'more-itertools==8.11.0;python_version>="3.5"',
162160
"cssselect==1.1.0",
161+
"sortedcontainers==2.4.0",
163162
'filelock==3.2.1;python_version<"3.6"',
164163
'filelock==3.3.2;python_version>="3.6"',
165164
'fasteners==0.16;python_version<"3.5"',
@@ -188,7 +187,7 @@
188187
"sbvirtualdisplay==1.0.0",
189188
'soupsieve==1.9.6;python_version<"3.5"',
190189
'soupsieve==2.1;python_version>="3.5" and python_version<"3.6"',
191-
'soupsieve==2.3;python_version>="3.6"',
190+
'soupsieve==2.3.1;python_version>="3.6"',
192191
'beautifulsoup4==4.9.3;python_version<"3.5"',
193192
'beautifulsoup4==4.10.0;python_version>="3.5"',
194193
'cryptography==2.9.2;python_version<"3.5"',
@@ -224,6 +223,7 @@
224223
'Pillow==6.2.2;python_version<"3.5"',
225224
'Pillow==7.2.0;python_version>="3.5" and python_version<"3.6"',
226225
'Pillow==8.4.0;python_version>="3.6"',
226+
'typing-extensions==3.10.0.2;python_version<"3.8"', # Sync with "rich"
227227
'rich==10.13.0;python_version>="3.6" and python_version<"4.0"',
228228
'tornado==5.1.1;python_version<"3.5"',
229229
'tornado==6.1;python_version>="3.5"',
@@ -235,7 +235,7 @@
235235
# pip install -e .[coverage]
236236
"coverage": [
237237
'coverage==5.5;python_version<"3.6"',
238-
'coverage==6.1.1;python_version>="3.6"',
238+
'coverage==6.1.2;python_version>="3.6"',
239239
'pytest-cov==2.12.1;python_version<"3.6"',
240240
'pytest-cov==3.0.0;python_version>="3.6"',
241241
],

0 commit comments

Comments
 (0)