Skip to content

Commit 5f26c1f

Browse files
authored
Merge pull request #1422 from seleniumbase/refresh-python-dependencies
Handle edge cases after successful actions and refresh dependencies
2 parents 289c214 + e85a902 commit 5f26c1f

File tree

7 files changed

+25
-20
lines changed

7 files changed

+25
-20
lines changed

examples/hack_the_planet.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ def test_all_your_base_are_belong_to_us(self):
175175
self.highlight('a[aria-label*="Try PlayF"]', loops=4, scroll=False)
176176
self.highlight('a[aria-label*="Sign in to"]', loops=6, scroll=False)
177177

178-
self.open("https://www.snapchat.com/")
179-
self.set_text_content("h1", aybabtu)
180-
zoom_out = "h1{zoom: 0.85;-moz-transform: scale(0.85);}"
181-
self.add_css_style(zoom_out)
182-
self.highlight("h1", loops=8, scroll=False)
183-
184178
self.open("https://store.steampowered.com/")
185179
self.set_text_content('div.content a[href*="/about/"]', " ")
186180
self.set_text_content('div.content a[href*="help.steam"]', aybabtu)

examples/parameterized_test.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class GoogleTests(BaseCase):
77
[
88
["Download Python", "Download Python", "img.python-logo"],
99
["Wikipedia", "www.wikipedia.org", "img.central-featured-logo"],
10-
["SeleniumBase GitHub.com", "SeleniumBase", 'img[title*="Sele"]'],
10+
["SeleniumBase.io Docs", "SeleniumBase", 'img[alt*="SeleniumB"]'],
1111
]
1212
)
1313
def test_parameterized_google_search(self, search_key, expected_text, img):
@@ -18,7 +18,5 @@ def test_parameterized_google_search(self, search_key, expected_text, img):
1818
self.click('a:contains("%s")' % expected_text)
1919
self.assert_element(img)
2020
if "SeleniumBase" in search_key:
21-
self.click('img[alt="SeleniumBase Docs"]')
22-
self.assert_element('[title="SeleniumBase Docs"]')
23-
self.click('a:contains("Features List")')
24-
self.assert_text("Features List", "h1")
21+
self.click('img[alt="SeleniumBase"]')
22+
self.assert_element('img[title="SeleniumBase"]')

examples/test_docs_site.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
class DocsSiteTests(BaseCase):
55
def test_docs(self):
66
self.open("https://seleniumbase.io/")
7-
self.delete_all_cookies()
87
self.assert_text("SeleniumBase", "h1")
98
self.js_click('a[href="help_docs/features_list/"]')
109
self.assert_exact_text("Features List", "h1")
@@ -14,13 +13,13 @@ def test_docs(self):
1413
self.assert_exact_text("Command Line Options", "h1")
1514
self.js_click('a[href="../../examples/example_logs/ReadMe/"]')
1615
self.assert_exact_text("Dashboard / Reports", "h1")
17-
self.js_click('[href="../../../seleniumbase/console_scripts/ReadMe/"]')
16+
self.js_click('a[href*="/seleniumbase/console_scripts/ReadMe/"]')
1817
self.assert_exact_text("Console Scripts", "h1")
1918
self.js_click('a[href="../../../help_docs/syntax_formats/"]')
2019
self.assert_exact_text("Syntax Formats", "h1")
2120
self.js_click('a[href="../recorder_mode/"]')
2221
self.assert_exact_text("Recorder Mode", "h1")
2322
self.js_click('a[href="../method_summary/"]')
2423
self.assert_exact_text("API Reference", "h1")
25-
self.js_click('img[alt="logo"]')
24+
self.click('img[alt="logo"]')
2625
self.assert_text("SeleniumBase", "h1")

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pytest-html==1.22.1;python_version<"3.6"
7070
pytest-html==2.0.1;python_version>="3.6"
7171
pytest-metadata==1.8.0;python_version<"3.6"
7272
pytest-metadata==1.11.0;python_version>="3.6" and python_version<"3.7"
73-
pytest-metadata==2.0.1;python_version>="3.7"
73+
pytest-metadata==2.0.2;python_version>="3.7"
7474
pytest-ordering==0.6
7575
pytest-rerunfailures==8.0;python_version<"3.6"
7676
pytest-rerunfailures==10.2;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__ = "3.5.5"
2+
__version__ = "3.5.6"

seleniumbase/fixtures/base_case.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ def open(self, url):
192192
if "ERR_CONNECTION_TIMED_OUT" in e.msg:
193193
time.sleep(0.5)
194194
self.driver.get(url)
195+
elif (
196+
"cannot determine loading status" in e.msg
197+
or "unexpected command response" in e.msg
198+
):
199+
pass # Odd issue where the open did happen. Continue.
195200
else:
196201
raise Exception(e.msg)
197202
if self.driver.current_url == pre_action_url and pre_action_url != url:
@@ -377,7 +382,10 @@ def click(
377382
)
378383
element.click()
379384
except WebDriverException as e:
380-
if "cannot determine loading status" in e.msg:
385+
if (
386+
"cannot determine loading status" in e.msg
387+
or "unexpected command response" in e.msg
388+
):
381389
pass # Odd issue where the click did happen. Continue.
382390
else:
383391
self.wait_for_ready_state_complete()
@@ -603,7 +611,10 @@ def update_text(
603611
try:
604612
element.send_keys(Keys.RETURN)
605613
except WebDriverException as e:
606-
if "cannot determine loading status" in e.msg:
614+
if (
615+
"cannot determine loading status" in e.msg
616+
or "unexpected command response" in e.msg
617+
):
607618
pass # Odd issue where the click did happen. Continue.
608619
else:
609620
raise e
@@ -623,7 +634,10 @@ def update_text(
623634
try:
624635
element.send_keys(Keys.RETURN)
625636
except WebDriverException as e:
626-
if "cannot determine loading status" in e.msg:
637+
if (
638+
"cannot determine loading status" in e.msg
639+
or "unexpected command response" in e.msg
640+
):
627641
pass # Odd issue where the click did happen. Continue.
628642
else:
629643
raise e

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
'pytest-html==2.0.1;python_version>="3.6"', # Newer ones had issues
196196
'pytest-metadata==1.8.0;python_version<"3.6"',
197197
'pytest-metadata==1.11.0;python_version>="3.6" and python_version<"3.7"', # noqa: E501
198-
'pytest-metadata==2.0.1;python_version>="3.7"',
198+
'pytest-metadata==2.0.2;python_version>="3.7"',
199199
"pytest-ordering==0.6",
200200
'pytest-rerunfailures==8.0;python_version<"3.6"',
201201
'pytest-rerunfailures==10.2;python_version>="3.6"',

0 commit comments

Comments
 (0)