Skip to content

Commit b3bb993

Browse files
committed
Refactor the extended "driver" instance
1 parent 9cf8f52 commit b3bb993

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

seleniumbase/fixtures/page_actions.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ def is_element_enabled(driver, selector, by="css selector"):
107107
return False
108108

109109

110-
def is_text_visible(driver, text, selector, by="css selector", browser=None):
110+
def is_text_visible(
111+
driver, text, selector="html", by="css selector", browser=None
112+
):
111113
"""
112114
Returns whether the text substring is visible in the given selector.
113115
@Params
114116
driver - the webdriver object (required)
115117
text - the text string to search for (required)
116-
selector - the locator for identifying the page element (required)
118+
selector - the locator for identifying the page element
117119
by - the type of selector being used (Default: "css selector")
118120
@Returns
119121
Boolean (is text visible)
@@ -1640,7 +1642,7 @@ def assert_text(
16401642
):
16411643
browser = driver.capabilities["browserName"].lower()
16421644
wait_for_text_visible(
1643-
driver, text, selector, by=by, timeout=timeout, browser=browser
1645+
driver, text.strip(), selector, by=by, timeout=timeout, browser=browser
16441646
)
16451647

16461648

@@ -1649,7 +1651,7 @@ def assert_exact_text(
16491651
):
16501652
browser = driver.capabilities["browserName"].lower()
16511653
wait_for_exact_text_visible(
1652-
driver, text, selector, by=by, timeout=timeout, browser=browser
1654+
driver, text.strip(), selector, by=by, timeout=timeout, browser=browser
16531655
)
16541656

16551657

0 commit comments

Comments
 (0)