-
-
Notifications
You must be signed in to change notification settings - Fork 23
Decorators for test methods
horejsek edited this page Mar 5, 2013
·
1 revision
class TestCase(WebdriverTestCase):
@GoToPage('http://www.google.com')
@ShouldBeOnPage('doodles/finder/2013/All%20doodles')
def test(self):
self.click('gbqfsb')
self.contains_text('Doodles')
By default WebdriverTestCase
looks for error messages in elements with class error
. If you want to test that some page have some error message, use this decorator.
You can override method get_errors
which returns list of error messages on page.
class TestCase(WebdriverTestCase):
@ShouldBeError('some-error')
def test(self):
# ...
Same as ShouldBeError
, but no error is also OK.