2018-04-24 15:00:19 +00:00
|
|
|
from pypom import Page
|
|
|
|
from selenium.webdriver.common.by import By
|
|
|
|
|
|
|
|
|
|
|
|
class Base(Page):
|
2018-04-24 15:07:11 +00:00
|
|
|
"""Base object model."""
|
2018-04-24 15:00:19 +00:00
|
|
|
|
|
|
|
_url = '{base_url}'
|
|
|
|
_send_logo_locator = (By.CLASS_NAME, 'logo')
|
|
|
|
|
|
|
|
def __init__(self, selenium, base_url, locale='en-US', **kwargs):
|
|
|
|
super(Base, self).__init__(
|
|
|
|
selenium, base_url, locale=locale, timeout=10, **kwargs)
|
|
|
|
|
|
|
|
def wait_for_page_to_load(self):
|
|
|
|
self.wait.until(
|
|
|
|
lambda _: self.find_element(
|
|
|
|
*self._send_logo_locator).is_displayed())
|
|
|
|
return self
|