# Path: src/factory/factory_method.py
# class MenuAndSearchTest(TemplateTest):
#     """
#     Implement a test case for checking menu and search
#     """
# 
#     def __init__(self, driver: Union[Chrome, Firefox]):
#         """
# 
#         :param driver: browser driver
#         :type driver: object
#         """
#         self.__driver = driver
#         super().__init__()
# 
#     def create_test(self):
#         """
# 
#         :return: sections to be tested
#         :rtype: dict
#         """
#         self.add_sections('menu', MenuComponent(self.__driver))
#         self.add_sections('search', SearchComponent(self.__driver))
# 
# Path: src/utils.py
# def get_selenium_driver(browser_name: str) -> Union[Chrome, Firefox]:
#     """
#     Return the same instance to the Selenium driver.
# 
#     :param browser_name: the name of the browser: chrome or mozilla
#     :type browser_name: str
#     :return: an instance of the required driver.
#     :rtype: Union[Chrome, Mozilla]
#     """
#     if browser_name.upper() == 'CHROME':
#         return SingletonFactory.build(Chrome)
# 
#     elif browser_name.upper() == 'Mozilla':
#         return SingletonFactory.build(Firefox)
# 
#     else:
#         raise NotImplementedError


from unittest import TestCase
from src.factory.factory_method import MenuAndSearchTest
from src.utils import get_selenium_driver
import time
Description: Test module for module src/factory/simple_factory.py

@author: Paul Bodean
@date: 12/08/2017
"""





class TestFactoryMethod(TestCase):
    """
    Check simple factory functionality
    """

    def setUp(self):
        """
        Driver + factory setup
        :return: driver
        :rtype: object
        """
        self.dr = get_selenium_driver('chrome')
        self.dr.set_window_size(1200, 800)
        self.dr.get('https://www.youtube.com/')

    def test_menu_and_search(self):
        """
        Perform some clicks and search for a song
        """
        # driver = self.setUp()

# Path: src/factory/factory_method.py
# class MenuAndSearchTest(TemplateTest):
#     """
#     Implement a test case for checking menu and search
#     """
# 
#     def __init__(self, driver: Union[Chrome, Firefox]):
#         """
# 
#         :param driver: browser driver
#         :type driver: object
#         """
#         self.__driver = driver
#         super().__init__()
# 
#     def create_test(self):
#         """
# 
#         :return: sections to be tested
#         :rtype: dict
#         """
#         self.add_sections('menu', MenuComponent(self.__driver))
#         self.add_sections('search', SearchComponent(self.__driver))
# 
# Path: src/utils.py
# def get_selenium_driver(browser_name: str) -> Union[Chrome, Firefox]:
#     """
#     Return the same instance to the Selenium driver.
# 
#     :param browser_name: the name of the browser: chrome or mozilla
#     :type browser_name: str
#     :return: an instance of the required driver.
#     :rtype: Union[Chrome, Mozilla]
#     """
#     if browser_name.upper() == 'CHROME':
#         return SingletonFactory.build(Chrome)
# 
#     elif browser_name.upper() == 'Mozilla':
#         return SingletonFactory.build(Firefox)
# 
#     else:
#         raise NotImplementedError


# Path: tests/factory/test_factory_method.py
from unittest import TestCase
from src.factory.factory_method import MenuAndSearchTest
from src.utils import get_selenium_driver
import time

Description: Test module for module src/factory/simple_factory.py

@author: Paul Bodean
@date: 12/08/2017
"""





class TestFactoryMethod(TestCase):
    """
    Check simple factory functionality
    """

    def setUp(self):
        """
        Driver + factory setup
        :return: driver
        :rtype: object
        """
        self.dr = get_selenium_driver('chrome')
        self.dr.set_window_size(1200, 800)
        self.dr.get('https://www.youtube.com/')

    def test_menu_and_search(self):
        """
        Perform some clicks and search for a song
        """
        # driver = self.setUp()

        demo = MenuAndSearchTest(self.dr)