Skip to content

Commit

Permalink
Merge pull request #1 from stevenerat/develop
Browse files Browse the repository at this point in the history
Merging fix for the upstream issue Element-34#50 to my master
  • Loading branch information
stevenerat committed Jan 29, 2014
2 parents 53034f2 + e83dbcf commit f4da574
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions saunter/matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,15 @@ def assert_text_present(self, text, msg=None):
:params text: the string to search for
:params msg: (Optional) msg explaining the difference
"""
e = driver.find_element_by_tag_name('body')
assert text in e.text
try:
locator = ("xpath=//*[contains(text(), '%s')]") % text
self.driver.find_element_by_locator(locator)
return True
except:
if len(msg) == 0:
raise AssertionError('Text "%s" was not found.' % text)
else:
raise AssertionError('Text "%s" was not found. %s' % (text,msg))

def verify_text_present(self, text, msg=None):
"""
Expand Down

0 comments on commit f4da574

Please sign in to comment.