# Path: src/page_object_pattern/home_page.py
# class HomePage(BasePage):
#     """
#     Home page
#     """
#     SEARCH_CONTAINER = 'searchInput'
#     SEARCH_BUTTON = 'searchButton'
#     CREATE_ACCOUNT = 'pt-createaccount'
#     LOGIN = 'pt-login'
# 
#     def set_search_query(self, query: str):
#         """
#         Search for a string
#         :param query: string you are looking for
#         """
#         self._driver.find_element_by_id(HomePage.SEARCH_CONTAINER).send_keys(query)
# 
#     def check_search(self):
#         """
#         Check search button is visible
#         """
#         return self._driver.find_element_by_id(HomePage.SEARCH_BUTTON).is_displayed()
# 
#     def search(self):
#         """
#         Click on search button
#         """
#         self._driver.find_element_by_id(HomePage.SEARCH_BUTTON).click()
# 
#     def check_login(self):
#         """
#         Check Login button is visible
#         """
#         return self._driver.find_element_by_id(HomePage.LOGIN).is_displayed()
# 
#     def login(self):
#         """
#         Press login button
#         """
#         self._driver.find_element_by_id(HomePage.LOGIN).click()
# 
#     def check_create_account(self):
#         """
#         Check create account button available
#         """
#         return self._driver.find_element_by_id(HomePage.CREATE_ACCOUNT).is_displayed()
# 
#     def create_account(self):
#         """
#         Press create account button
#         """
#         self._driver.find_element_by_id(HomePage.CREATE_ACCOUNT).click()
# 
# Path: src/page_object_pattern/test_template.py
# class TestTemplate(unittest.TestCase):
#     def setUp(self):
#         """
#         Open the page to be tested
#         :return: the driver implementation
#         """
# 
#         self.driver = webdriver.Chrome()
#         self.driver.get("https://en.wikipedia.org/wiki/Main_Page")
# 
#     def tearDown(self):
#         """
#         Quit the browser
#         """
#         self.driver.quit()


from src.page_object_pattern.home_page import HomePage
from src.page_object_pattern.test_template import TestTemplate
"""
Description: Test module for module src/page_object_patter/base_page.py

@author: Paul Bodean
@date: 25/07/2017
"""



class TestHomePage(TestTemplate):
    """
    Check page page functionality
    """

    def test_buttons_available(self):
        """
        Check Home page buttons are displayed
        """
        main_page = HomePage(self.driver)
        assert main_page.check_create_account()
        assert main_page.check_login()
        assert main_page.check_search()

    def test_buttons_click(self):
        """
        Click on home page buttons
        """

# Path: src/page_object_pattern/home_page.py
# class HomePage(BasePage):
#     """
#     Home page
#     """
#     SEARCH_CONTAINER = 'searchInput'
#     SEARCH_BUTTON = 'searchButton'
#     CREATE_ACCOUNT = 'pt-createaccount'
#     LOGIN = 'pt-login'
# 
#     def set_search_query(self, query: str):
#         """
#         Search for a string
#         :param query: string you are looking for
#         """
#         self._driver.find_element_by_id(HomePage.SEARCH_CONTAINER).send_keys(query)
# 
#     def check_search(self):
#         """
#         Check search button is visible
#         """
#         return self._driver.find_element_by_id(HomePage.SEARCH_BUTTON).is_displayed()
# 
#     def search(self):
#         """
#         Click on search button
#         """
#         self._driver.find_element_by_id(HomePage.SEARCH_BUTTON).click()
# 
#     def check_login(self):
#         """
#         Check Login button is visible
#         """
#         return self._driver.find_element_by_id(HomePage.LOGIN).is_displayed()
# 
#     def login(self):
#         """
#         Press login button
#         """
#         self._driver.find_element_by_id(HomePage.LOGIN).click()
# 
#     def check_create_account(self):
#         """
#         Check create account button available
#         """
#         return self._driver.find_element_by_id(HomePage.CREATE_ACCOUNT).is_displayed()
# 
#     def create_account(self):
#         """
#         Press create account button
#         """
#         self._driver.find_element_by_id(HomePage.CREATE_ACCOUNT).click()
# 
# Path: src/page_object_pattern/test_template.py
# class TestTemplate(unittest.TestCase):
#     def setUp(self):
#         """
#         Open the page to be tested
#         :return: the driver implementation
#         """
# 
#         self.driver = webdriver.Chrome()
#         self.driver.get("https://en.wikipedia.org/wiki/Main_Page")
# 
#     def tearDown(self):
#         """
#         Quit the browser
#         """
#         self.driver.quit()


# Path: tests/page_object_pattern/test_home_page.py
from src.page_object_pattern.home_page import HomePage
from src.page_object_pattern.test_template import TestTemplate

"""
Description: Test module for module src/page_object_patter/base_page.py

@author: Paul Bodean
@date: 25/07/2017
"""



class TestHomePage(TestTemplate):
    """
    Check page page functionality
    """

    def test_buttons_available(self):
        """
        Check Home page buttons are displayed
        """
        main_page = HomePage(self.driver)
        assert main_page.check_create_account()
        assert main_page.check_login()
        assert main_page.check_search()

    def test_buttons_click(self):
        """
        Click on home page buttons
        """

        main_page = HomePage(self.driver)