Skip to content

Commit b5218fd

Browse files
authored
Merge pull request #1110 from seleniumbase/options-dependencies-and-docs
Update dependencies, default options, and docs
2 parents 1035ab9 + 70f7314 commit b5218fd

File tree

11 files changed

+42
-27
lines changed

11 files changed

+42
-27
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ The code above will leave your browser window open in case there's a failure. (i
306306
--port=PORT # (The Selenium Grid port used by the test server.)
307307
--proxy=SERVER:PORT # (Connect to a proxy server:port for tests.)
308308
--proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.)
309+
--proxy-bypass-list=STRING # (";"-separated hosts to bypass, Eg "*.foo.com")
309310
--agent=STRING # (Modify the web browser's User-Agent string.)
310311
--mobile # (Use the mobile device emulator while running tests.)
311312
--metrics=STRING # (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)

examples/test_download_files.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ def test_download_files(self):
6060

6161
# Get file sizes in kB to compare actual values with displayed values
6262
whl_file_kb = whl_file_bytes / 1000.0
63-
whl_line = self.get_text("tbody tr:nth-of-type(1) th")
63+
whl_line_fi = self.get_text('a[href$=".whl"]')
64+
whl_line = self.get_text('tbody th:contains("%s")' % whl_line_fi)
6465
whl_display_kb = float(whl_line.split("(")[1].split(" ")[0])
6566
tar_gz_file_kb = tar_gz_file_bytes / 1000.0
66-
tar_gz_line = self.get_text("tbody tr:nth-of-type(2) th")
67+
tar_gz_line_fi = self.get_text('a[href$=".tar.gz"]')
68+
tar_gz_line = self.get_text('tbody th:contains("%s")' % tar_gz_line_fi)
6769
tar_gz_display_kb = float(tar_gz_line.split("(")[1].split(" ")[0])
6870

6971
# Verify downloaded files are the correct size (account for rounding)

help_docs/customizing_test_runs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ SeleniumBase provides additional ``pytest`` command-line options for tests:
120120
--port=PORT # (The Selenium Grid port used by the test server.)
121121
--proxy=SERVER:PORT # (Connect to a proxy server:port for tests.)
122122
--proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.)
123+
--proxy-bypass-list=STRING # (";"-separated hosts to bypass, Eg "*.foo.com")
123124
--agent=STRING # (Modify the web browser's User-Agent string.)
124125
--mobile # (Use the mobile device emulator while running tests.)
125126
--metrics=STRING # (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lunr==0.6.1;python_version>="3.6"
2121
nltk==3.6.5;python_version>="3.6"
2222
watchdog==2.1.6;python_version>="3.6"
2323
mkdocs==1.2.3;python_version>="3.6"
24-
mkdocs-material==8.0.3;python_version>="3.6"
24+
mkdocs-material==8.0.5;python_version>="3.6"
2525
mkdocs-exclude-search==0.5.4;python_version>="3.6"
2626
mkdocs-simple-hooks==0.1.3
2727
mkdocs-material-extensions==1.0.3;python_version>="3.6"

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packaging>=20.9;python_version<"3.6"
44
packaging>=21.3;python_version>="3.6"
55
setuptools>=44.1.1;python_version<"3.5"
66
setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"
7-
setuptools>=59.4.0;python_version>="3.6"
7+
setuptools>=59.5.0;python_version>="3.6"
88
setuptools-scm>=5.0.2;python_version<"3.6"
99
setuptools-scm>=6.3.2;python_version>="3.6"
1010
tomli>=1.2.2;python_version>="3.6"
@@ -25,7 +25,7 @@ idna==2.10;python_version<"3.6"
2525
idna==3.3;python_version>="3.6"
2626
chardet==3.0.4;python_version<"3.5"
2727
chardet==4.0.0;python_version>="3.5"
28-
charset-normalizer==2.0.8;python_version>="3.5"
28+
charset-normalizer==2.0.9;python_version>="3.5"
2929
urllib3==1.26.7
3030
requests==2.26.0;python_version<"3.5"
3131
requests==2.25.1;python_version>="3.5" and python_version<"3.6"

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.2.7"
2+
__version__ = "2.2.8"

seleniumbase/core/browser_launcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def _set_firefox_options(
507507
options.set_preference("pdfjs.disabled", True)
508508
options.set_preference("app.update.auto", False)
509509
options.set_preference("app.update.enabled", False)
510-
options.set_preference("app.update.silent", True)
510+
options.set_preference("app.update.silent", False)
511511
options.set_preference("browser.formfill.enable", False)
512512
options.set_preference("browser.privatebrowsing.autostart", False)
513513
options.set_preference("devtools.errorconsole.enabled", True)
@@ -519,7 +519,7 @@ def _set_firefox_options(
519519
options.set_preference("extensions.systemAddon.update.enabled", False)
520520
options.set_preference("extensions.update.autoUpdateDefault", False)
521521
options.set_preference("extensions.update.enabled", False)
522-
options.set_preference("extensions.update.silent", True)
522+
options.set_preference("extensions.update.silent", False)
523523
options.set_preference("datareporting.healthreport.service.enabled", False)
524524
options.set_preference("datareporting.healthreport.uploadEnabled", False)
525525
options.set_preference("datareporting.policy.dataSubmissionEnabled", False)

seleniumbase/fixtures/base_case.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,8 +2716,7 @@ def get_new_driver(
27162716
servername - if using a Selenium Grid, set the host address here
27172717
port - if using a Selenium Grid, set the host port here
27182718
proxy - if using a proxy server, specify the "host:port" combo here
2719-
proxy_bypass_list - Semi-colon seperated string of domains to not
2720-
use a proxy for or * to bypass all
2719+
proxy_bypass_list - ";"-separated hosts to bypass (Eg. "*.foo.com")
27212720
switch_to - the option to switch to the new driver (default = True)
27222721
cap_file - the file containing desired capabilities for the browser
27232722
cap_string - the string with desired capabilities for the browser

seleniumbase/plugins/pytest_plugin.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def pytest_addoption(parser):
3737
--cap-string=STRING (The web browser's desired capabilities to use.)
3838
--proxy=SERVER:PORT (Connect to a proxy server:port for tests.)
3939
--proxy=USERNAME:PASSWORD@SERVER:PORT (Use authenticated proxy server.)
40-
--proxy-bypass-list=STRING (Semi-colon seperated string of domains to not
41-
use a proxy for or * to bypass all)
40+
--proxy-bypass-list=STRING (";"-separated hosts to bypass, Eg "*.foo.com")
4241
--agent=STRING (Modify the web browser's User-Agent string.)
4342
--mobile (Use the mobile device emulator while running tests.)
4443
--metrics=STRING (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)
@@ -388,14 +387,21 @@ def pytest_addoption(parser):
388387
)
389388
parser.addoption(
390389
"--proxy-bypass-list",
390+
"--proxy_bypass_list",
391391
action="store",
392392
dest="proxy_bypass_list",
393393
default=None,
394-
help="""Designates the domains or IP address to bypass the defined proxy.
395-
Format: example.test OR
396-
example.test,anothorexample.test OR
397-
*
398-
Default: ''.""",
394+
help="""Designates the hosts, domains, and/or IP addresses
395+
to bypass when using a proxy server with "--proxy".
396+
Format: A ";"-separated string.
397+
Example usage:
398+
pytest
399+
--proxy="username:password@servername:port"
400+
--proxy-bypass-list="*.foo.com;github.com"
401+
pytest
402+
--proxy="servername:port"
403+
--proxy-bypass-list="127.0.0.1:8080"
404+
Default: None.""",
399405
)
400406
parser.addoption(
401407
"--agent",

seleniumbase/plugins/selenium_plugin.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ class SeleniumBrowser(Plugin):
2121
--cap-string=STRING (The web browser's desired capabilities to use.)
2222
--proxy=SERVER:PORT (Connect to a proxy server:port for tests.)
2323
--proxy=USERNAME:PASSWORD@SERVER:PORT (Use authenticated proxy server.)
24-
--proxy-bypass-list=STRING (Semi-colon seperated string of domains to not
25-
use a proxy for or * to bypass all)
24+
--proxy-bypass-list=STRING (";"-separated hosts to bypass, Eg "*.foo.com")
2625
--agent=STRING (Modify the web browser's User-Agent string.)
2726
--mobile (Use the mobile device emulator while running tests.)
2827
--metrics=STRING (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)
@@ -161,14 +160,21 @@ def options(self, parser, env):
161160
)
162161
parser.add_option(
163162
"--proxy-bypass-list",
163+
"--proxy_bypass_list",
164164
action="store",
165165
dest="proxy_bypass_list",
166166
default=None,
167-
help="""Designates the domains or IP address to bypass the defined proxy.
168-
Format: example.test OR
169-
example.test,anothorexample.test OR
170-
*
171-
Default: ''.""",
167+
help="""Designates the hosts, domains, and/or IP addresses
168+
to bypass when using a proxy server with "--proxy".
169+
Format: A ";"-separated string.
170+
Example usage:
171+
pytest
172+
--proxy="username:password@servername:port"
173+
--proxy-bypass-list="*.foo.com;github.com"
174+
pytest
175+
--proxy="servername:port"
176+
--proxy-bypass-list="127.0.0.1:8080"
177+
Default: None.""",
172178
)
173179
parser.add_option(
174180
"--agent",

0 commit comments

Comments
 (0)