Skip to content

Commit dd21d43

Browse files
committed
Fixes Page Should Contain Text should not log source on success case
1 parent 03310b5 commit dd21d43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AppiumLibrary/keywords/_element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def page_should_contain_text(self, text, loglevel='INFO'):
8686
using the log level specified with the optional `loglevel` argument.
8787
Giving `NONE` as level disables logging.
8888
"""
89-
if unicode(text) not in self.log_source(loglevel):
89+
if not self._is_text_present(text):
9090
self.log_source(loglevel)
9191
raise AssertionError("Page should have contained text '%s' "
9292
"but did not" % text)
@@ -99,7 +99,7 @@ def page_should_not_contain_text(self, text, loglevel='INFO'):
9999
using the log level specified with the optional `loglevel` argument.
100100
Giving `NONE` as level disables logging.
101101
"""
102-
if unicode(text) in self.log_source(loglevel):
102+
if self._is_text_present(text):
103103
self.log_source(loglevel)
104104
raise AssertionError("Page should not have contained text '%s'" % text)
105105
self._info("Current page does not contains text '%s'." % text)

0 commit comments

Comments
 (0)