/
is_text_present.py
30 lines (22 loc) · 1.3 KB
/
is_text_present.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from nose.tools import assert_true, assert_false
class IsTextPresentTest(object):
def test_is_text_present(self):
"should verify if text is present"
assert_true(self.browser.is_text_present('Example Header'))
def test_is_text_present_and_should_return_false(self):
"should verify if text is present and return false"
assert_false(self.browser.is_text_present('Text that not exist'))
def test_is_text_present_and_should_wait_time(self):
"should verify if text is present and wait for five seconds"
self.browser.find_link_by_text('FOO').first.click()
assert_true(self.browser.is_text_present('BAR!', wait_time=5))
def test_is_text_not_present(self):
"should verify if text is not present"
assert_true(self.browser.is_text_not_present('Text that not exist'))
def test_is_text_not_present_and_should_return_false(self):
"should verify if text is not prasent and return false"
assert_false(self.browser.is_text_not_present('Example Header'))
def test_is_text_not_present_and_should_wait_time(self):
"should verify if text is not present and wait for five seconds"
self.browser.find_link_by_text('FOO').first.click()
assert_true(self.browser.is_text_not_present('another text', wait_time=5))