Skip to content

Commit 19ea7e1

Browse files
authored
Merge pull request #1681 from seleniumbase/even-more-bug-fixes
Even more bug fixes
2 parents ea421b9 + 75ebec7 commit 19ea7e1

17 files changed

+104
-130
lines changed

examples/github_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from seleniumbase import BaseCase
2+
BaseCase.main(__name__, __file__)
23

34

45
class GitHubTests(BaseCase):

examples/hack_the_planet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Video Link: https://youtu.be/1s-Tj65AKZA """
22
from seleniumbase import BaseCase
3+
BaseCase.main(__name__, __file__)
34

45

56
class HackTests(BaseCase):

examples/proxy_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
from seleniumbase.config import settings
12
from seleniumbase import BaseCase
3+
BaseCase.main(__name__, __file__)
24

35

46
class ProxyTests(BaseCase):
57
def test_proxy(self):
8+
settings.SKIP_JS_WAITS = True
9+
if not self.page_load_strategy == "none":
10+
# This page takes too long to load otherwise
11+
self.get_new_driver(page_load_strategy="none")
612
self.open("https://ipinfo.io/")
713
ip_address = self.get_text('#ip-string span[class*="primary"] span')
814
print("\n\nMy IP Address = %s\n" % ip_address)

examples/raw_browser_launcher.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616

1717
# Example 2 using default args or command-line options
1818
driver = Driver()
19-
driver.get("https://seleniumbase.github.io/demo_page")
20-
js_utils.highlight_with_js(driver, "h2", loops=5)
21-
by_css = "css selector"
22-
driver.find_element(by_css, "#myTextInput").send_keys("Automation")
23-
driver.find_element(by_css, "#checkBox1").click()
24-
js_utils.highlight_with_js(driver, "img", loops=5)
25-
driver.quit() # If the script fails early, the driver still quits
19+
try:
20+
driver.get("https://seleniumbase.github.io/demo_page")
21+
js_utils.highlight_with_js(driver, "h2", loops=5)
22+
by_css = "css selector"
23+
driver.find_element(by_css, "#myTextInput").send_keys("Automation")
24+
driver.find_element(by_css, "#checkBox1").click()
25+
js_utils.highlight_with_js(driver, "img", loops=5)
26+
finally:
27+
driver.quit()

examples/raw_driver_context.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
driver.get("https://seleniumbase.github.io/")
99
js_utils.highlight_with_js(driver, 'img[alt="SeleniumBase"]', loops=6)
1010

11+
with DriverContext(browser="chrome", incognito=True) as driver:
12+
driver.get("https://seleniumbase.io/apps/calculator")
13+
page_actions.wait_for_element(driver, "4", by="id").click()
14+
page_actions.wait_for_element(driver, "2", by="id").click()
15+
page_actions.wait_for_text(driver, "42", "output", by="id")
16+
js_utils.highlight_with_js(driver, "#output", loops=6)
17+
1118
with DriverContext() as driver:
1219
driver.get("https://seleniumbase.github.io/demo_page")
1320
js_utils.highlight_with_js(driver, "h2", loops=5)
1421
by_css = "css selector"
1522
driver.find_element(by_css, "#myTextInput").send_keys("Automation")
1623
driver.find_element(by_css, "#checkBox1").click()
1724
js_utils.highlight_with_js(driver, "img", loops=5)
18-
19-
with DriverContext(browser="chrome", incognito=True) as driver:
20-
driver.get("https://seleniumbase.io/apps/calculator")
21-
page_actions.wait_for_element(driver, "4", by="id").click()
22-
page_actions.wait_for_element(driver, "2", by="id").click()
23-
page_actions.wait_for_text(driver, "42", "output", by="id")
24-
js_utils.highlight_with_js(driver, "#output", loops=6)

examples/test_docs_site.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from seleniumbase import BaseCase
2+
BaseCase.main(__name__, __file__)
23

34

45
class DocsSiteTests(BaseCase):

examples/test_select_options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from seleniumbase import BaseCase
2+
BaseCase.main(__name__, __file__)
23

34

45
class SelectTestClass(BaseCase):

examples/test_show_file_choosers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55
import os
66
from seleniumbase import BaseCase
7+
BaseCase.main(__name__, __file__)
78

89

910
class FileUpload(BaseCase):

examples/test_tinymce.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from seleniumbase import BaseCase
2+
BaseCase.main(__name__, __file__)
23

34

45
class TinyMceTests(BaseCase):

examples/test_todomvc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from parameterized import parameterized
22
from seleniumbase import BaseCase
3+
BaseCase.main(__name__, __file__)
34

45

56
class TodoMVC(BaseCase):

help_docs/syntax_formats.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -832,20 +832,20 @@ with DriverContext() as driver:
832832
driver.get("https://seleniumbase.github.io/")
833833
js_utils.highlight_with_js(driver, 'img[alt="SeleniumBase"]', loops=6)
834834

835+
with DriverContext(browser="chrome", incognito=True) as driver:
836+
driver.get("https://seleniumbase.io/apps/calculator")
837+
page_actions.wait_for_element(driver, "4", by="id").click()
838+
page_actions.wait_for_element(driver, "2", by="id").click()
839+
page_actions.wait_for_text(driver, "42", "output", by="id")
840+
js_utils.highlight_with_js(driver, "#output", loops=6)
841+
835842
with DriverContext() as driver:
836843
driver.get("https://seleniumbase.github.io/demo_page")
837844
js_utils.highlight_with_js(driver, "h2", loops=5)
838845
by_css = "css selector"
839846
driver.find_element(by_css, "#myTextInput").send_keys("Automation")
840847
driver.find_element(by_css, "#checkBox1").click()
841848
js_utils.highlight_with_js(driver, "img", loops=5)
842-
843-
with DriverContext(browser="chrome", incognito=True) as driver:
844-
driver.get("https://seleniumbase.io/apps/calculator")
845-
page_actions.wait_for_element(driver, "4", by="id").click()
846-
page_actions.wait_for_element(driver, "2", by="id").click()
847-
page_actions.wait_for_text(driver, "42", "output", by="id")
848-
js_utils.highlight_with_js(driver, "#output", loops=6)
849849
```
850850

851851
(See <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_driver_context.py">examples/raw_driver_context.py</a> for an example.)
@@ -874,13 +874,15 @@ finally:
874874

875875
# Example 2 using default args or command-line options
876876
driver = Driver()
877-
driver.get("https://seleniumbase.github.io/demo_page")
878-
js_utils.highlight_with_js(driver, "h2", loops=5)
879-
by_css = "css selector"
880-
driver.find_element(by_css, "#myTextInput").send_keys("Automation")
881-
driver.find_element(by_css, "#checkBox1").click()
882-
js_utils.highlight_with_js(driver, "img", loops=5)
883-
driver.quit() # If the script fails early, the driver still quits
877+
try:
878+
driver.get("https://seleniumbase.github.io/demo_page")
879+
js_utils.highlight_with_js(driver, "h2", loops=5)
880+
by_css = "css selector"
881+
driver.find_element(by_css, "#myTextInput").send_keys("Automation")
882+
driver.find_element(by_css, "#checkBox1").click()
883+
js_utils.highlight_with_js(driver, "img", loops=5)
884+
finally:
885+
driver.quit()
884886
```
885887

886888
(From <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_browser_launcher.py">examples/raw_browser_launcher.py</a>)

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cssselect2==0.7.0
2929
tinycss2==1.2.1
3030
defusedxml==0.7.1
3131
mkdocs==1.4.2
32-
mkdocs-material==9.0.4
32+
mkdocs-material==9.0.5
3333
mkdocs-exclude-search==0.6.4
3434
mkdocs-simple-hooks==0.1.5
3535
mkdocs-material-extensions==1.1.1

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ iniconfig==2.0.0;python_version>="3.7"
5555
pluggy==1.0.0;python_version>="3.6"
5656
py==1.11.0;python_version>="3.6"
5757
pytest==7.0.1;python_version<"3.7"
58-
pytest==7.2.0;python_version>="3.7"
58+
pytest==7.2.1;python_version>="3.7"
5959
pytest-forked==1.4.0;python_version>="3.6"
6060
pytest-html==2.0.1;python_version>="3.6"
6161
pytest-metadata==1.11.0;python_version<"3.7"
@@ -89,7 +89,7 @@ cffi==1.15.1
8989
typing-extensions==4.1.1;python_version>="3.6" and python_version<"3.7"
9090
typing-extensions==4.4.0;python_version>="3.7" and python_version<"3.9"
9191
rich==12.6.0;python_version>="3.6" and python_version<"3.7"
92-
rich==13.0.1;python_version>="3.7" and python_version<"4.0"
92+
rich==13.1.0;python_version>="3.7" and python_version<"4.0"
9393

9494
# --- Testing Requirements --- #
9595
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)

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__ = "4.11.4"
2+
__version__ = "4.11.5"

0 commit comments

Comments
 (0)