Skip to content

Commit 9823a7e

Browse files
committed
Merge pull request #99 from adwu73/cfsnc
add keyword Current Frame Should Not Contain
2 parents 6793340 + cb50f08 commit 9823a7e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Selenium2Library/keywords/_element.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ def current_frame_contains(self, text, loglevel='INFO'):
2222
"but did not" % text)
2323
self._info("Current page contains text '%s'." % text)
2424

25+
26+
def current_frame_should_not_contain(self, text, loglevel='INFO'):
27+
"""Verifies that current frame contains `text`.
28+
29+
See `Page Should Contain ` for explanation about `loglevel` argument.
30+
"""
31+
if self._is_text_present(text):
32+
self.log_source(loglevel)
33+
raise AssertionError("Page should not have contained text '%s' "
34+
"but it did" % text)
35+
self._info("Current page should not contain text '%s'." % text)
36+
2537
def element_should_contain(self, locator, expected, message=''):
2638
"""Verifies element identified by `locator` contains text `expected`.
2739

0 commit comments

Comments
 (0)