Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setup_driver(scenario):
"""Scenario initialization
:param scenario: running scenario
"""
if not hasattr(world, 'config_files'):
world.config_files = ConfigFiles()
# By default config directory is located in terrain path
if not world.config_files.config_directory:
world.config_files.set_config_directory(DriverWrappersPool.get_default_config_directory())
world.global_status = {'test_passed': True}
bdd_common_before_scenario(world, scenario)
world.reuse_driver = world.toolium_config.getboolean_optional('Driver', 'reuse_driver')
install_pytest_asserts()
# Get 'Config_environment' property from user input (e.g. -D Config_environment=ios)
env = context.config.userdata.get('Config_environment')
# Deprecated: Get 'env' property from user input (e.g. -D env=ios)
env = env if env else context.config.userdata.get('env')
if env:
os.environ['Config_environment'] = env
if not hasattr(context, 'config_files'):
context.config_files = ConfigFiles()
context.config_files = DriverWrappersPool.initialize_config_files(context.config_files)
# By default config directory is located in environment path
if not context.config_files.config_directory:
context.config_files.set_config_directory(DriverWrappersPool.get_default_config_directory())
context.global_status = {'test_passed': True}
create_and_configure_wrapper(context)
# Behave dynamic environment
context.dyn_env = DynamicEnvironment(logger=context.logger)
def setup_driver(scenario):
"""Scenario initialization
:param scenario: running scenario
"""
if not hasattr(world, 'config_files'):
world.config_files = ConfigFiles()
# By default config directory is located in terrain path
if not world.config_files.config_directory:
world.config_files.set_config_directory(DriverWrappersPool.get_default_config_directory())
world.global_status = {'test_passed': True}
bdd_common_before_scenario(world, scenario)