Merge "Replace 'raise AssertionError' with 'self.assertIn'"
This commit is contained in:
commit
d9b0880fec
@ -12,9 +12,10 @@
|
||||
import selenium.common.exceptions as Exceptions
|
||||
import selenium.webdriver.support.ui as Support
|
||||
from selenium.webdriver.support import wait
|
||||
import unittest
|
||||
|
||||
|
||||
class BaseWebObject(object):
|
||||
class BaseWebObject(unittest.TestCase):
|
||||
"""Base class for all web objects."""
|
||||
def __init__(self, driver, conf):
|
||||
self.driver = driver
|
||||
|
@ -27,10 +27,9 @@ class PageObject(basewebobject.BaseWebObject):
|
||||
return self.driver.title
|
||||
|
||||
def is_the_current_page(self):
|
||||
if self._page_title not in self.page_title:
|
||||
raise AssertionError(
|
||||
"Expected to find %s in page title, instead found: %s"
|
||||
% (self._page_title, self.page_title))
|
||||
self.assertIn(self._page_title, self.page_title,
|
||||
"Expected to find %s in page title, instead found: %s"
|
||||
% (self._page_title, self.page_title))
|
||||
return True
|
||||
|
||||
def get_url_current_page(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user