Beispiel #1
0
def before_all(context):
    """Initialization method that will be executed before the test execution

    :param context: behave context
    """
    # Use pytest asserts if behave_pytest is installed
    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)
Beispiel #2
0
def before_all(context):
    """Initialization method that will be executed before the test execution

    :param context: behave context
    """
    # Use pytest asserts if behave_pytest is installed
    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)
Beispiel #3
0
def before_all(context):
    """Initialization method that will be executed before the test execution

    :param context: behave context
    """
    # Use pytest asserts if behave_pytest is installed
    install_pytest_asserts()

    if not hasattr(context, 'config_files'):
        context.config_files = ConfigFiles()

    # 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())

    # Get 'env' property from user input (e.g. -D env=ios)
    env = context.config.userdata.get('env')
    if env:
        context.config_files.set_config_properties_filenames('properties.cfg', '{}-properties.cfg'.format(env),
                                                             'local-{}-properties.cfg'.format(env))
        context.config_files.set_output_log_filename('toolium_{}.log'.format(env))

    context.global_status = {'test_passed': True}
    create_and_configure_wrapper(context)
Beispiel #4
0
def before_all(context):
    install_pytest_asserts()
Beispiel #5
0
def before_all(context):
    install_pytest_asserts()
    context.cluster = "testcluster"
    context.mesos_cli_config = os.path.join(os.getcwd(), 'mesos-cli.json')
    wait_for_marathon()
    setup_mesos_cli_config(context.mesos_cli_config, context.cluster)
Beispiel #6
0
def before_all(context):
    install_pytest_asserts()
    context.cluster = "testcluster"
    context.mesos_cli_config = os.path.join(os.getcwd(), 'mesos-cli.json')
    wait_for_marathon()
    setup_mesos_cli_config(context.mesos_cli_config, context.cluster)
Beispiel #7
0
def before_all(context):
    """Set global variables."""
    install_pytest_asserts()
    context.browser = get_chrome_webdriver()