예제 #1
0
def setup():
    """Setup server and shell objects"""
    global shell_objects_dict
    shell_objects_dict = {}

    windmill.settings["shell_objects"] = shell_objects_dict
    assert not windmill.settings.get("setup_has_run", False)

    httpd, httpd_thread = run_threaded(windmill.settings["CONSOLE_LOG_LEVEL"])

    shell_objects_dict["httpd"] = httpd
    shell_objects_dict["httpd_thread"] = httpd_thread

    from windmill.bin import shell_objects

    if windmill.settings["CONTINUE_ON_FAILURE"] is not False:
        shell_objects.jsonrpc_client.add_json_command(
            '{"method": "commands.setOptions", "params": {"stopOnFailure" : false}}'
        )

    if windmill.settings["EXTENSIONS_DIR"] is not None:
        shell_objects.load_extensions_dir(windmill.settings["EXTENSIONS_DIR"])

    if windmill.settings["RUN_TEST"] is not None:
        shell_objects.run_test(windmill.settings["RUN_TEST"])
    if windmill.settings["LOAD_TEST"] is not None:
        shell_objects.load_test(windmill.settings["LOAD_TEST"])

    if windmill.settings["JAVASCRIPT_TEST_DIR"]:
        shell_objects.run_js_tests(
            windmill.settings["JAVASCRIPT_TEST_DIR"],
            windmill.settings["JAVASCRIPT_TEST_FILTER"],
            windmill.settings["JAVASCRIPT_TEST_PHASE"],
        )

    browser = [
        setting
        for setting in windmill.settings.keys()
        if setting.startswith("START_") and windmill.settings[setting] is True
    ]

    import shell_objects

    if len(browser) is 1:
        shell_objects_dict["browser"] = getattr(shell_objects, browser[0].lower())()

    for attribute in dir(shell_objects):
        shell_objects_dict[attribute] = getattr(shell_objects, attribute)

    shell_objects_dict["setup_has_run"] = True

    return shell_objects_dict
예제 #2
0
def setup():
    """Setup server and shell objects"""
    global shell_objects_dict
    shell_objects_dict = {}

    windmill.settings['shell_objects'] = shell_objects_dict
    assert not windmill.settings.get('setup_has_run', False)

    httpd, httpd_thread = run_threaded(windmill.settings['CONSOLE_LOG_LEVEL'])

    shell_objects_dict['httpd'] = httpd
    shell_objects_dict['httpd_thread'] = httpd_thread

    from windmill.bin import shell_objects

    if windmill.settings['CONTINUE_ON_FAILURE'] is not False:
        shell_objects.jsonrpc_client.add_json_command(
            '{"method": "commands.setOptions", "params": {"stopOnFailure" : false}}'
        )

    if windmill.settings['EXTENSIONS_DIR'] is not None:
        shell_objects.load_extensions_dir(windmill.settings['EXTENSIONS_DIR'])

    if windmill.settings['RUN_TEST'] is not None:
        shell_objects.run_test(windmill.settings['RUN_TEST'])
    if windmill.settings['LOAD_TEST'] is not None:
        shell_objects.load_test(windmill.settings['LOAD_TEST'])

    if windmill.settings['JAVASCRIPT_TEST_DIR']:
        shell_objects.run_js_tests(windmill.settings['JAVASCRIPT_TEST_DIR'],
                                   windmill.settings['JAVASCRIPT_TEST_FILTER'],
                                   windmill.settings['JAVASCRIPT_TEST_PHASE'])

    browser = [setting for setting in windmill.settings.keys() if setting.startswith('START_') and \
                                                                  windmill.settings[setting] is True]

    import shell_objects

    if len(browser) is 1:
        shell_objects_dict['browser'] = getattr(shell_objects,
                                                browser[0].lower())()

    for attribute in dir(shell_objects):
        shell_objects_dict[attribute] = getattr(shell_objects, attribute)

    shell_objects_dict['setup_has_run'] = True

    return shell_objects_dict
예제 #3
0
파일: __init__.py 프로젝트: ellen/cosmo
def setup_module(module):
    windmill_setup(module)
    from windmill.bin import shell_objects
    shell_objects.load_extensions_dir(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'extensions'))
    RunJsonFile('create_registry.json', lines=[registry_line])()
예제 #4
0
def setup_module(module):
    windmill_setup(module)
    from windmill.bin import shell_objects
    shell_objects.load_extensions_dir(
        os.path.join(os.path.abspath(os.path.dirname(__file__)), 'extensions'))
    RunJsonFile('create_registry.json', lines=[registry_line])()