Esempio n. 1
0
def test_before_scenario_no_driver(start_driver, add_assert_screenshot_methods):
    # Create context mock
    context = mock.MagicMock()
    context.toolium_config = ExtendedConfigParser()
    scenario = mock.MagicMock()
    scenario.tags = ['a', 'no_driver', 'b']

    before_scenario(context, scenario)

    # Check that start_driver is called
    start_driver.assert_called_once_with(context, True)
Esempio n. 2
0
def test_before_scenario_reset_driver(start_driver, DriverWrappersPool, add_assert_screenshot_methods):
    # Create context mock
    context = mock.MagicMock()
    context.toolium_config = ExtendedConfigParser()
    scenario = mock.MagicMock()
    scenario.tags = ['a', 'reset_driver', 'b']

    before_scenario(context, scenario)

    # Check that start_driver and stop drivers are called
    start_driver.assert_called_once_with(context, False)
    DriverWrappersPool.stop_drivers.assert_called_once_with()