Exemplo n.º 1
0
def process_execution_starting_request(request, clear=True):
    if clear:
        registry.clear()
        load_impls(get_step_impl_dirs())
    execution_info = create_execution_context_from(
        request.currentExecutionInfo)
    response = run_hook(request, registry.before_suite(), execution_info)
    _add_message_and_screenshots(response)
    return response
Exemplo n.º 2
0
def main():
    init(autoreset=True, strip=False)
    print(Style.DIM + "Python: {}".format(platform.python_version()))
    if sys.argv[1] == "--init":
        copy_skel_files()
    else:
        s = connection.connect()
        api.connect_to_api()
        load_impls()
        api.close_api()
        processor.dispatch_messages(s)
Exemplo n.º 3
0
def _execute_before_suite_hook(request, response, _socket, clear=True):
    if clear:
        registry.clear()
        load_impls(get_step_impl_dir())
    if environ.get('DEBUGGING'):
        ptvsd.enable_attach('',
                            address=('0.0.0.0',
                                     int(environ.get('DEBUG_PORT'))))
        logging.info(ATTACH_DEBUGGER_EVENT)
        ptvsd.wait_for_attach()

    execution_info = create_execution_context_from(
        request.executionStartingRequest.currentExecutionInfo)
    run_hook(request, response, registry.before_suite(), execution_info)
Exemplo n.º 4
0
def _execute_before_suite_hook(request, response, _socket, clear=True):
    if clear:
        registry.clear()
        load_impls(get_step_impl_dir())
    if environ.get('DEBUGGING'):
        ptvsd.enable_attach('', address=('127.0.0.1', int(environ.get('DEBUG_PORT'))))
        logging.info(ATTACH_DEBUGGER_EVENT)
        t = Timer(int(environ.get("debugger_wait_time", 30)), handle_detached)
        t.start()
        ptvsd.wait_for_attach()
        t.cancel()

    execution_info = create_execution_context_from(request.executionStartingRequest.currentExecutionInfo)
    run_hook(request, response, registry.before_suite(), execution_info)
    response.executionStatusResponse.executionResult.message.extend(MessagesStore.pending_messages())
Exemplo n.º 5
0
def _execute_before_suite_hook(request, response, _socket, clear=True):
    if clear:
        registry.clear()
        load_impls(get_step_impl_dir())
    if environ.get('DEBUGGING'):
        ptvsd.enable_attach('',
                            address=('127.0.0.1',
                                     int(environ.get('DEBUG_PORT'))))
        logging.info(ATTACH_DEBUGGER_EVENT)
        signal.signal(signal.SIGALRM, handle_detached)
        signal.alarm(int(environ.get("debugger_wait_time", 30)))
        ptvsd.wait_for_attach()

    execution_info = create_execution_context_from(
        request.executionStartingRequest.currentExecutionInfo)
    run_hook(request, response, registry.before_suite(), execution_info)