How to use the getgauge.registry.MessagesStore.pending_messages function in getgauge

To help you get started, we’ve selected a few getgauge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getgauge / gauge-python / tests / test_python.py View on Github external
def test_pending_messages_gives_only_those_messages_which_are_not_reported(self):
        messages = ['HAHAHAH', 'HAHAHAH1', 'HAHAHAH2', 'HAHAHAH3']
        for message in messages:
            Messages.write_message(message)
        pending_messages = MessagesStore.pending_messages()
        self.assertEqual(messages, pending_messages)

        pending_messages = MessagesStore.pending_messages()

        self.assertEqual([], pending_messages)

        messages = ['HAHAHAH', 'HAHAHAH1']
        for message in messages:
            Messages.write_message(message)

        pending_messages = MessagesStore.pending_messages()

        self.assertEqual(messages, pending_messages)
github getgauge / gauge-python / tests / test_python.py View on Github external
def test_pending_messages(self):
        messages = ['HAHAHAH', 'HAHAHAH1', 'HAHAHAH2', 'HAHAHAH3']
        for message in messages:
            Messages.write_message(message)
        pending_messages = MessagesStore.pending_messages()
        self.assertEqual(messages, pending_messages)
github getgauge / gauge-python / tests / test_python.py View on Github external
def test_clear(self):
        messages = ['HAHAHAH', 'HAHAHAH1', 'HAHAHAH2', 'HAHAHAH3']
        for message in messages:
            Messages.write_message(message)
        MessagesStore.clear()
        pending_messages = MessagesStore.pending_messages()
        self.assertEqual([], pending_messages)
github getgauge / gauge-python / getgauge / processor.py View on Github external
def _add_message_and_screenshots(response):
    response.executionResult.message.extend(MessagesStore.pending_messages())
    response.executionResult.screenshots.extend(
        ScreenshotsStore.pending_screenshots())
github getgauge / gauge-python / getgauge / executor.py View on Github external
def _add_exception(e, response, continue_on_failure):
    if os.getenv('screenshot_on_failure') == 'true':
        screenshot = registry.screenshot_provider()()
        response.executionResult.screenShot = screenshot
        response.executionResult.failureScreenshot = screenshot
    response.executionResult.failed = True
    message = e.__str__()
    if not message:
        message = "Exception occurred"
    response.executionResult.errorMessage = message
    response.executionResult.stackTrace = traceback.format_exc()
    response.executionResult.errorType = ProtoExecutionResult.ASSERTION
    if continue_on_failure:
        response.executionResult.recoverableError = True
    response.executionResult.message.extend(MessagesStore.pending_messages())
    response.executionResult.screenshots.extend(ScreenshotsStore.pending_screenshots())
github getgauge / gauge-python / getgauge / executor.py View on Github external
def execute_method(params, step, response, is_continue_on_failure=_false):
    start = _current_time()
    try:
        params = _get_args(params, step)
        step.impl(*params)
    except Exception as e:
        _add_exception(e, response, is_continue_on_failure(step.impl, e))
    response.executionResult.executionTime = _current_time() - start
    response.executionResult.message.extend(MessagesStore.pending_messages())
    response.executionResult.screenshots.extend(ScreenshotsStore.pending_screenshots())