def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper new_driver_wrapper = DriverWrappersPool.get_default_wrapper() # Configure wrapper config_files = ConfigFiles() root_path = os.path.dirname(os.path.realpath(__file__)) config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_output_directory(os.path.join(root_path, 'output')) config_files.set_config_log_filename('logging.conf') new_driver_wrapper.configure(config_files) yield new_driver_wrapper # Remove used environment properties after test global environment_properties for env_property in environment_properties: try: del os.environ[env_property] except KeyError: pass environment_properties = []
def driver_wrapper(): """Create a new mock element and a new driver before each test""" global mock_element mock_element = mock.MagicMock(spec=WebElement) mock_element.find_element.return_value = child_element # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper driver_wrapper = DriverWrappersPool.get_default_wrapper() # Configure wrapper root_path = os.path.dirname(os.path.realpath(__file__)) config_files = ConfigFiles() config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_output_directory(os.path.join(root_path, 'output')) config_files.set_config_log_filename('logging.conf') DriverWrappersPool.configure_common_directories(config_files) driver_wrapper.configure_properties() driver_wrapper.driver = mock.MagicMock() driver_wrapper.is_mobile_test = mock.MagicMock(return_value=False) return driver_wrapper
def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper driver_wrapper = DriverWrappersPool.get_default_wrapper() driver_wrapper.driver = mock.MagicMock() return driver_wrapper
def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper driver_wrapper = DriverWrappersPool.get_default_wrapper() driver_wrapper.driver = mock.MagicMock() return driver_wrapper
def setUp(self): # Reset wrappers pool values DriverWrappersPool._empty_pool() # Create default wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() # Configure properties config_files = ConfigFiles() root_path = os.path.dirname(os.path.realpath(__file__)) config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_output_directory(os.path.join(root_path, 'output')) self.driver_wrapper.configure(tc_config_files=config_files)
def setUp(self): # Reset wrappers pool values DriverWrappersPool._empty_pool() # Create default wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() # Configure properties config_files = ConfigFiles() root_path = os.path.dirname(os.path.realpath(__file__)) config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_output_directory(os.path.join(root_path, 'output')) self.driver_wrapper.configure(tc_config_files=config_files)
def setUp(self): """Create a new mock element and a new driver before each test""" global mock_element mock_element = mock.MagicMock(spec=WebElement) mock_element.find_element.return_value = child_element # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() self.driver_wrapper.driver = mock.MagicMock()
def setUp(self): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() config_files = ConfigFiles() config_files.set_config_directory(os.path.join(self.root_path, 'conf')) config_files.set_output_directory(os.path.join(self.root_path, 'output')) DriverWrappersPool.configure_common_directories(config_files) self.driver_wrapper.configure_properties()
def setUp(self): """Create a new mock element and a new driver before each test""" global mock_element mock_element = mock.MagicMock(spec=WebElement) mock_element.find_element.return_value = child_element # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() self.driver_wrapper.driver = mock.MagicMock()
def setUp(self): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() config_files = ConfigFiles() config_files.set_config_directory(os.path.join(self.root_path, 'conf')) config_files.set_output_directory( os.path.join(self.root_path, 'output')) DriverWrappersPool.configure_common_directories(config_files) self.driver_wrapper.configure_properties()
def setUp(self): """Create a new mock element and a new driver before each test""" # Create a mock element self.mock_element = mock.MagicMock(spec=WebElement) self.mock_element.find_element.return_value = child_element self.mock_element.text = 'text value' self.mock_element.get_attribute.return_value = 'input text value' # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() self.driver_wrapper.driver = mock.MagicMock()
def setUp(self): """Create a new mock element and a new driver before each test""" # Create a mock element self.mock_element = mock.MagicMock(spec=WebElement) self.mock_element.find_element.return_value = child_element self.mock_element.text = 'text value' self.mock_element.get_attribute.return_value = 'input text value' # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() self.driver_wrapper.driver = mock.MagicMock()
def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper new_driver_wrapper = DriverWrappersPool.get_default_wrapper() # Configure wrapper config_files = ConfigFiles() root_path = os.path.dirname(os.path.realpath(__file__)) config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_output_directory(os.path.join(root_path, 'output')) config_files.set_config_log_filename('logging.conf') new_driver_wrapper.configure(config_files) return new_driver_wrapper
def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper new_driver_wrapper = DriverWrappersPool.get_default_wrapper() # Configure wrapper config_files = ConfigFiles() root_path = os.path.dirname(os.path.realpath(__file__)) config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_output_directory(os.path.join(root_path, 'output')) config_files.set_config_log_filename('logging.conf') new_driver_wrapper.configure(config_files) return new_driver_wrapper
def driver_wrapper(): # Create a mock element global mock_element mock_element = mock.MagicMock(spec=WebElement) mock_element.find_element.return_value = child_element mock_element.text = 'text value' mock_element.get_attribute.return_value = 'input text value' # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper driver_wrapper = DriverWrappersPool.get_default_wrapper() driver_wrapper.driver = mock.MagicMock() return driver_wrapper
def driver_wrapper(): # Create a mock element global mock_element mock_element = mock.MagicMock(spec=WebElement) mock_element.find_element.return_value = child_element mock_element.text = 'text value' mock_element.get_attribute.return_value = 'input text value' # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper driver_wrapper = DriverWrappersPool.get_default_wrapper() driver_wrapper.driver = mock.MagicMock() return driver_wrapper
def setUp(self): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() self.driver_wrapper.driver = mock.MagicMock() # Configure properties self.root_path = os.path.dirname(os.path.realpath(__file__)) config_files = ConfigFiles() config_files.set_config_directory(os.path.join(self.root_path, 'conf')) config_files.set_config_properties_filenames('properties.cfg') config_files.set_output_directory(os.path.join(self.root_path, 'output')) self.driver_wrapper.configure(tc_config_files=config_files) # Create a new Utils instance self.utils = Utils()
def setUp(self): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper self.driver_wrapper = DriverWrappersPool.get_default_wrapper() self.driver_wrapper.driver = mock.MagicMock() # Configure properties self.root_path = os.path.dirname(os.path.realpath(__file__)) config_files = ConfigFiles() config_files.set_config_directory(os.path.join(self.root_path, 'conf')) config_files.set_config_properties_filenames('properties.cfg') config_files.set_output_directory(os.path.join(self.root_path, 'output')) self.driver_wrapper.configure(tc_config_files=config_files) # Create a new Utils instance self.utils = Utils()
def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper driver_wrapper = DriverWrappersPool.get_default_wrapper() driver_wrapper.driver = mock.MagicMock() # Configure properties root_path = os.path.dirname(os.path.realpath(__file__)) config_files = ConfigFiles() config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_config_properties_filenames('properties.cfg') config_files.set_output_directory(os.path.join(root_path, 'output')) driver_wrapper.configure(config_files) yield driver_wrapper # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None
def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper driver_wrapper = DriverWrappersPool.get_default_wrapper() driver_wrapper.driver = mock.MagicMock() # Configure properties root_path = os.path.dirname(os.path.realpath(__file__)) config_files = ConfigFiles() config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_config_properties_filenames('properties.cfg') config_files.set_output_directory(os.path.join(root_path, 'output')) driver_wrapper.configure(config_files) yield driver_wrapper # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None
def driver_wrapper(): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None # Create a new wrapper new_driver_wrapper = DriverWrappersPool.get_default_wrapper() # Configure wrapper config_files = ConfigFiles() root_path = os.path.dirname(os.path.realpath(__file__)) config_files.set_config_directory(os.path.join(root_path, 'conf')) config_files.set_output_directory(os.path.join(root_path, 'output')) config_files.set_config_log_filename('logging.conf') DriverWrappersPool.configure_common_directories(config_files) new_driver_wrapper.configure_logger() yield new_driver_wrapper # Remove environment properties after test try: del os.environ["Config_prop_filenames"] except KeyError: pass
def tearDownClass(cls): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None
def tearDownClass(cls): # Reset wrappers pool values DriverWrappersPool._empty_pool() DriverWrapper.config_properties_filenames = None