Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions examples/hack_the_planet.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
""" Video Link: https://youtu.be/1s-Tj65AKZA """
from seleniumbase import __version__
from seleniumbase import BaseCase


class HackTests(BaseCase):
def test_all_your_base_are_belong_to_us(self):
# First make sure that seleniumbase 1.65.0 or newer is installed
version = __version__.split(".")
if version[0] == "1" and int(version[1]) < 65:
raise Exception(
"This test requires minimum seleniumbase version: 1.65.0"
)
self.set_window_size(1220, 740)
ayb = "ALL YOUR BASE"
abtu = "ARE BELONG TO US"
Expand Down
6 changes: 5 additions & 1 deletion examples/offline_examples/test_demo_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def test_demo_page(self):

# Verify that a hover dropdown link changes page text
self.assert_text("Automation Practice", "h3")
self.hover_and_click("#myDropdown", "#dropOption2")
try:
self.hover_and_click("#myDropdown", "#dropOption2", timeout=1)
except Exception:
# If someone moves the mouse while the test runs
self.js_click("#dropOption2")
self.assert_text("Link Two Selected", "h3")

# Verify that a button click changes text on the page
Expand Down
4 changes: 2 additions & 2 deletions examples/proxy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
class ProxyTests(BaseCase):
def test_proxy(self):
self.open("https://ipinfo.io/")
ip_address = self.get_text("div.home-ip-details span.value")[1:-1]
ip_address = self.get_text('#ip-string span[class*="primary"] span')
print("\n\nMy IP Address = %s\n" % ip_address)
print("Displaying Host Info:")
text = self.get_text("div.home-ip-details").split("asn:")[0]
text = self.get_text("#widget-scrollable-container").split("asn:")[0]
rows = text.split("\n")
data = []
for row in rows:
Expand Down
8 changes: 8 additions & 0 deletions examples/pure_python.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Running tests with pure "python" instead of directly calling "pytest".
To run, use: "python pure_python.py".
Two examples: pytest.main() and subprocess.call()."""
import pytest
import subprocess

pytest.main(["test_mfa_login.py", "--chrome", "-v"])
subprocess.call(["pytest", "test_mfa_login.py", "--chrome", "-v"])
8 changes: 6 additions & 2 deletions examples/test_iframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ def test_iframe_basics(self):
self.assert_text("HTML Iframes", "h2")
self.switch_to_frame('[title*="Iframe"]') # Enter iframe inside iframe
self.assert_text("This page is displayed in an iframe", "h1")
self.switch_to_default_content() # Exit all iFrames
self.switch_to_parent_frame() # Exit only the inner iframe
self.assert_text("Use CSS width & height to specify", "p")
self.switch_to_frame('[title*="Iframe"]') # Enter iframe inside iframe
self.assert_text("seleniumbase.io/w3schools/iframes", "a")
self.switch_to_default_content() # Exit all iframes
self.click("button#runbtn")
self.switch_to_frame("iframeResult") # Go back inside 1st iframe
self.highlight('iframe[title="Iframe Example"]')
Expand All @@ -20,7 +24,7 @@ def test_set_content_to_frame(self):
self.set_content_to_frame("iframe")
self.assert_element_not_visible("iframe")
self.highlight("body")
self.set_content_to_default(nested=False)
self.set_content_to_parent()
self.highlight('iframe[title="Iframe Example"]')
self.set_content_to_default()
self.click("button#runbtn")
Expand Down
8 changes: 7 additions & 1 deletion help_docs/method_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,15 @@ self.switch_to_frame(frame, timeout=None)

self.switch_to_default_content()

self.switch_to_parent_frame()

self.set_content_to_frame(frame, timeout=None)

self.set_content_to_default(nested=True)
self.set_content_to_default(nested=False)
# Duplicates: self.set_content_to_default_content(nested=False)

self.set_content_to_parent()
# Duplicates: self.set_content_to_parent_frame()

self.open_new_window(switch_to=True)
# Duplicates: self.open_new_tab(switch_to=True)
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "2.4.33"
__version__ = "2.4.34"
Loading