Example #1
0
def _execute_before_step_hook(request, response, _socket):
    MessagesStore.clear()
    execution_info = create_execution_context_from(
        request.stepExecutionStartingRequest.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + list(
        execution_info.specification.tags)
    run_hook(request, response, registry.before_step(tags), execution_info)
Example #2
0
def _execute_after_step_hook(request, response, _socket):
    execution_info = create_execution_context_from(
        request.stepExecutionEndingRequest.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + list(
        execution_info.specification.tags)
    run_hook(request, response, registry.after_step(tags), execution_info)
    response.executionStatusResponse.executionResult.message.extend(
        MessagesStore.pending_messages())
Example #3
0
def _execute_after_suite_hook(request, response, _socket):
    execution_info = create_execution_context_from(
        request.executionEndingRequest.currentExecutionInfo)
    run_hook(request, response, registry.after_suite(), execution_info)
    response.executionStatusResponse.executionResult.message.extend(
        MessagesStore.pending_messages())
    response.executionStatusResponse.executionResult.screenshots.extend(
        ScreenshotsStore.pending_screenshots())
Example #4
0
def _execute_before_spec_hook(request, response, _socket):
    execution_info = create_execution_context_from(
        request.specExecutionStartingRequest.currentExecutionInfo)
    run_hook(request, response,
             registry.before_spec(execution_info.specification.tags),
             execution_info)
    response.executionStatusResponse.executionResult.message.extend(
        MessagesStore.pending_messages())
Example #5
0
def _execute_before_scenario_hook(request, response, _socket):
    execution_info = create_execution_context_from(
        request.scenarioExecutionStartingRequest.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + \
        list(execution_info.specification.tags)
    run_hook(request, response, registry.before_scenario(tags), execution_info)
    response.executionStatusResponse.executionResult.message.extend(
        MessagesStore.pending_messages())
    response.executionStatusResponse.executionResult.screenshots.extend(
        ScreenshotsStore.pending_screenshots())
Example #6
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)
Example #7
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())
Example #8
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)
Example #9
0
def process_step_execution_ending_request(request):
    execution_info = create_execution_context_from(
        request.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + \
        list(execution_info.specification.tags)
    response = run_hook(request, registry.after_step(tags), execution_info)
    _add_message_and_screenshots(response)
    return response
Example #10
0
def process_spec_execution_starting_request(request):
    execution_info = create_execution_context_from(
        request.currentExecutionInfo)
    response = run_hook(
        request, registry.before_spec(execution_info.specification.tags),
        execution_info)
    _add_message_and_screenshots(response)
    return response
Example #11
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
Example #12
0
def _execute_after_suite_hook(request, response, socket):
    execution_info = create_execution_context_from(request.executionEndingRequest.currentExecutionInfo)
    run_hook(request, response, registry.after_suite(), execution_info)
Example #13
0
def _execute_after_scenario_hook(request, response, _socket):
    execution_info = create_execution_context_from(
        request.scenarioExecutionEndingRequest.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + list(
        execution_info.specification.tags)
    run_hook(request, response, registry.after_scenario(tags), execution_info)
Example #14
0
def _execute_after_step_hook(request, response, socket):
    execution_info = create_execution_context_from(request.stepExecutionEndingRequest.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + list(execution_info.specification.tags)
    run_hook(request, response, registry.after_step(tags), execution_info)
    response.executionStatusResponse.executionResult.message.extend(_MessagesStore.pending_messages())
Example #15
0
def _execute_before_step_hook(request, response, socket):
    _MessagesStore.clear()
    execution_info = create_execution_context_from(request.stepExecutionStartingRequest.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + list(execution_info.specification.tags)
    run_hook(request, response, registry.before_step(tags), execution_info)
Example #16
0
def _execute_after_scenario_hook(request, response, socket):
    execution_info = create_execution_context_from(request.scenarioExecutionEndingRequest.currentExecutionInfo)
    tags = list(execution_info.scenario.tags) + list(execution_info.specification.tags)
    run_hook(request, response, registry.after_scenario(tags), execution_info)
Example #17
0
def process_execution_ending_request(request):
    execution_info = create_execution_context_from(
        request.currentExecutionInfo)
    response = run_hook(request, registry.after_suite(), execution_info)
    _add_message_and_screenshots(response)
    return response
Example #18
0
def _execute_after_suite_hook(request, response, _socket):
    execution_info = create_execution_context_from(
        request.executionEndingRequest.currentExecutionInfo)
    run_hook(request, response, registry.after_suite(), execution_info)
Example #19
0
def _execute_before_suite_hook(request, response, socket):
    execution_info = create_execution_context_from(request.executionStartingRequest.currentExecutionInfo)
    run_hook(request, response, registry.before_suite(), execution_info)
Example #20
0
def _execute_before_spec_hook(request, response, _socket):
    execution_info = create_execution_context_from(
        request.specExecutionStartingRequest.currentExecutionInfo)
    run_hook(request, response,
             registry.before_spec(execution_info.specification.tags),
             execution_info)
Example #21
0
def _execute_after_spec_hook(request, response, socket):
    execution_info = create_execution_context_from(request.specExecutionEndingRequest.currentExecutionInfo)
    run_hook(request, response, registry.after_spec(execution_info.specification.tags), execution_info)