File tree Expand file tree Collapse file tree 7 files changed +30
-10
lines changed
Expand file tree Collapse file tree 7 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 1010class RepeatTests (BaseCase ):
1111 @parameterized .expand ([[]] * 2 )
1212 def test_repeat_this_test_with_parameterized (self ):
13- self .page_load_strategy = "none"
1413 self .open ("seleniumbase.github.io" )
1514 self .click ('a[href="help_docs/method_summary/"]' )
1615 self .assert_text ("API Reference" , "h1" )
1716
1817
1918@pytest .mark .parametrize ("" , [[]] * 2 )
2019def test_repeat_this_test_with_pytest_parametrize (sb ):
21- sb .page_load_strategy = "none"
2220 sb .open ("seleniumbase.github.io" )
2321 sb .click ('a[href="seleniumbase/console_scripts/ReadMe/"]' )
2422 sb .assert_text ("Console Scripts" , "h1" )
@@ -27,7 +25,6 @@ def test_repeat_this_test_with_pytest_parametrize(sb):
2725class RepeatTestsWithPytest :
2826 @pytest .mark .parametrize ("" , [[]] * 2 )
2927 def test_repeat_test_with_pytest_parametrize (self , sb ):
30- sb .page_load_strategy = "none"
3128 sb .open ("seleniumbase.github.io" )
3229 sb .click ('a[href="help_docs/customizing_test_runs/"]' )
3330 sb .assert_text ("Command Line Options" , "h1" )
Original file line number Diff line number Diff line change @@ -14,20 +14,20 @@ click==8.1.3
1414ghp-import == 2.1.0
1515readme-renderer == 37.3
1616pymdown-extensions == 9.11
17- importlib-metadata == 6.5 .0
17+ importlib-metadata == 6.6 .0
1818pipdeptree == 2.7.0
1919bleach == 6.0.0
2020lunr == 0.6.2
2121nltk == 3.8.1
22- tornado == 6.3
22+ tornado == 6.3.1
2323watchdog == 3.0.0
2424cairocffi == 1.5.1
2525cairosvg == 2.7.0
2626cssselect2 == 0.7.0
2727tinycss2 == 1.2.1
2828defusedxml == 0.7.1
2929mkdocs == 1.4.2
30- mkdocs-material == 9.1.6
30+ mkdocs-material == 9.1.7
3131mkdocs-exclude-search == 0.6.5
3232mkdocs-simple-hooks == 0.1.5
3333mkdocs-material-extensions == 1.1.1
Original file line number Diff line number Diff line change 11pip >= 21.3.1 ;python_version < "3.7"
2- pip >= 23.1 ;python_version >= "3.7"
2+ pip >= 23.1.1 ;python_version >= "3.7"
33packaging >= 21.3 ;python_version < "3.7"
44packaging >= 23.1 ;python_version >= "3.7"
55setuptools >= 59.6.0 ;python_version < "3.7"
Original file line number Diff line number Diff line change 11# seleniumbase package
2- __version__ = "4.14.1 "
2+ __version__ = "4.14.2 "
Original file line number Diff line number Diff line change 11""" SeleniumBase Exceptions
22 NoSuchFileException => Called when self.assert_downloaded_file(...) fails.
3+ NotConnectedException => Called when Internet is not reachable when needed.
34 NotUsingChromeException => Used by Chrome-only methods if not using Chrome.
45 NotUsingChromiumException => Used by Chromium-only methods if not Chromium.
56 OutOfScopeException => Used by BaseCase methods when setUp() is skipped.
@@ -13,6 +14,10 @@ class NoSuchFileException(Exception):
1314 pass
1415
1516
17+ class NotConnectedException (Exception ):
18+ pass
19+
20+
1621class NotUsingChromeException (Exception ):
1722 pass
1823
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ def test_anything(self):
6161from seleniumbase.__version__ import __version__
6262from seleniumbase.common import decorators
6363from seleniumbase.common.exceptions import (
64+ NotConnectedException,
6465 NotUsingChromeException,
6566 NotUsingChromiumException,
6667 OutOfScopeException,
@@ -249,12 +250,29 @@ def open(self, url):
249250 or "ERR_CONNECTION_CLOSED" in e.msg
250251 or "ERR_CONNECTION_RESET" in e.msg
251252 or "ERR_NAME_NOT_RESOLVED" in e.msg
252- or "ERR_INTERNET_DISCONNECTED" in e.msg
253253 ):
254254 shared_utils.check_if_time_limit_exceeded()
255255 self.__check_browser()
256256 time.sleep(0.8)
257257 self.driver.get(url)
258+ elif (
259+ "ERR_INTERNET_DISCONNECTED" in e.msg
260+ or "neterror?e=dnsNotFound" in e.msg
261+ ):
262+ shared_utils.check_if_time_limit_exceeded()
263+ self.__check_browser()
264+ time.sleep(1.05)
265+ try:
266+ self.driver.get(url)
267+ except Exception as e2:
268+ if (
269+ "ERR_INTERNET_DISCONNECTED" in e2.msg
270+ or "neterror?e=dnsNotFound" in e2.msg
271+ ):
272+ message = "Internet unreachable!"
273+ raise NotConnectedException(message)
274+ else:
275+ raise
258276 elif "Timed out receiving message from renderer" in e.msg:
259277 page_load_timeout = None
260278 if selenium4_or_newer:
Original file line number Diff line number Diff line change 123123 python_requires = ">=3.6" ,
124124 install_requires = [
125125 'pip>=21.3.1;python_version<"3.7"' ,
126- 'pip>=23.1;python_version>="3.7"' ,
126+ 'pip>=23.1.1 ;python_version>="3.7"' ,
127127 'packaging>=21.3;python_version<"3.7"' ,
128128 'packaging>=23.1;python_version>="3.7"' ,
129129 'setuptools>=59.6.0;python_version<"3.7"' ,
You can’t perform that action at this time.
0 commit comments