Exemplo n.º 1
0
def handle_error():
    if env.CASE_PASS == False:
        return

    if sys.exc_info()[0] != None:
        step_normal(common.exception_error())
        
        screenshot_name = "%s__%s__Error_%s.png" % (env.CASE_NAME, env.platformName, common.stamp_datetime_coherent())
        
        common.mkdirs("%s\\Result\\screenshots\\" % env.PROJECT_PATH)
        env.driver.save_screenshot(u"%s\\Result\\screenshots\\%s" % (env.PROJECT_PATH, screenshot_name))
        
        step_normal("Please check screen short [%s]" % screenshot_name)

        env.CASE_PASS = False
Exemplo n.º 2
0
def handle_error():
    if env.threadlocal.CASE_PASS == False:
        return
    
    
    if sys.exc_info()[0] != None:
        step_normal(common.exception_error())
        
        screenshot_name = "Fail__%s__%s__%s.png" % (common.stamp_datetime_coherent(), env.threadlocal.CASE_NAME, env.threadlocal.TESTING_BROWSER)
        
        try:
            save_screen_shot(screenshot_name)
        except:
            step_warning(str(sys.exc_info()))
        
        step_normal("Current step screen short [%s]" % (screenshot_name))
        
        env.HTMLREPORT_SCREENSHOT_NAME = screenshot_name
        
        env.threadlocal.CASE_PASS = False
        env.EXIT_STATUS = -1
Exemplo n.º 3
0
Arquivo: log.py Projeto: 123tw/knitter
def handle_error():
    if env.threadlocal.CASE_PASS == False:
        return
    
    
    if sys.exc_info()[0] != None:
        step_normal(common.exception_error())
        
        screenshot_name = "Fail__%s__%s__%s.png" % (common.stamp_datetime_coherent(), env.threadlocal.CASE_NAME, env.threadlocal.TESTING_BROWSER)
        
        try:
            save_screen_shot(screenshot_name)
        except:
            step_warning(str(sys.exc_info()))
        
        step_normal("Current step screen short [%s]" % (screenshot_name))
        
        env.HTMLREPORT_SCREENSHOT_NAME = screenshot_name
        
        env.threadlocal.CASE_PASS = False
        env.EXIT_STATUS = -1