Exemple #1
0
def _add_exception(e, response, continue_on_failure):
    if os.getenv('screenshot_on_failure') == 'true':
        response.executionStatusResponse.executionResult.screenShot = registry.screenshot_provider()()
    response.executionStatusResponse.executionResult.failed = True
    response.executionStatusResponse.executionResult.errorMessage = e.__str__()
    response.executionStatusResponse.executionResult.stackTrace = traceback.format_exc()
    response.executionStatusResponse.executionResult.errorType = ProtoExecutionResult.ASSERTION
    if continue_on_failure:
        response.executionStatusResponse.executionResult.recoverableError = True
def _add_exception(e, response, continue_on_failure):
    if os.getenv('screenshot_on_failure') == 'true':
        response.executionStatusResponse.executionResult.screenShot = registry.screenshot_provider(
        )()
    response.executionStatusResponse.executionResult.failed = True
    message = e.__str__()
    if not message:
        message = "Exception occurred"
    response.executionStatusResponse.executionResult.errorMessage = message
    response.executionStatusResponse.executionResult.stackTrace = traceback.format_exc(
    )
    response.executionStatusResponse.executionResult.errorType = ProtoExecutionResult.ASSERTION
    if continue_on_failure:
        response.executionStatusResponse.executionResult.recoverableError = True
 def test_screenshot_decorator(self):
     func = registry.screenshot_provider()
     expected = 'take_screenshot'
     self.assertEqual(expected, func.__name__)
Exemple #4
0
 def test_screenshot_decorator(self):
     func = registry.screenshot_provider()
     expected = 'take_screenshot'
     self.assertEqual(expected, func.__name__)
Exemple #5
0
 def setUp(self):
     self.__old_screenshot_provider = registry.screenshot_provider()
     self.__is_screenshot_writer  = registry.is_screenshot_writer
     os.environ["gauge_screenshots_dir"] = tempfile.mkdtemp()