Ejemplo n.º 1
0
def open_browser(browser_id=None):
    """Open a new browser. The param browser_id is optional
    and only used to manage more than one browser at the same time.
    Parameters:
    browser_id (optional) : value
    """
    step_message = 'Open browser'
    browser.open_browser(browser_id)
    _capture_or_add_step(step_message, execution.settings['screenshot_on_step'])
Ejemplo n.º 2
0
def open_browser(browser_id=None):
    """Open a new browser. The param browser_id is optional
    and only used to manage more than one browser at the same time.
    Parameters:
    browser_id (optional) : value
    """
    step_message = 'Open browser'
    browser.open_browser(browser_id)
    _capture_or_add_step(step_message, execution.settings['screenshot_on_step'])
Ejemplo n.º 3
0
 def test_driver_path_is_not_defined(self):
     execution.settings = settings_manager.assign_settings_default_values(
         {})
     execution.logger = test_logger.get_logger()
     default_browsers = gui_utils.get_supported_browsers_suggestions()
     drivers = [
         ('chromedriver_path', 'chrome'),
         ('chromedriver_path', 'chrome-headless'),
         ('edgedriver_path', 'edge'),
         ('geckodriver_path', 'firefox'),
         ('iedriver_path', 'ie'),
         ('operadriver_path', 'opera'),
     ]
     for setting_path, browser_name in drivers:
         execution.browser_definition = execution_runner.define_browsers(
             [browser_name], [], default_browsers, [])[0]
         with pytest.raises(Exception) as excinfo:
             browser.open_browser()
             expected = 'Exception: {setting_path} setting is not defined'
             assert expected in str(excinfo.value)
Ejemplo n.º 4
0
 def test_executable_not_present(self):
     execution.settings = settings_manager.assign_settings_default_values(
         {})
     execution.logger = test_logger.get_logger()
     default_browsers = gui_utils.get_supported_browsers_suggestions()
     drivers = [
         ('chromedriver_path', './drivers/chromedriver*', 'chrome'),
         ('chromedriver_path', './drivers/chromedriver*',
          'chrome-headless'),
         ('edgedriver_path', './drivers/edgedriver*', 'edge'),
         ('geckodriver_path', './drivers/geckodriver*', 'firefox'),
         ('iedriver_path', './drivers/iedriver*', 'ie'),
         ('operadriver_path', './drivers/operadriver*', 'opera'),
     ]
     for setting_key, setting_path, browser_name in drivers:
         execution.browser_definition = execution_runner.define_browsers(
             [browser_name], [], default_browsers, [])[0]
         execution.settings[setting_key] = setting_path
         with pytest.raises(Exception) as excinfo:
             browser.open_browser()
             expected = f'No executable file found using path {setting_path}'
             assert expected in str(excinfo.value)