#NEWLINE# def __run_test_case( case ) : #NEWLINE# #INDENT# module = importlib . import_module ( case . __module__ ) #NEWLINE# env . threadlocal . MODULE_NAME = case . __module__ . split ( '.' ) [ ( - 1 ) ] #NEWLINE# for browser in env . TESTING_BROWSERS . split ( '|' ) : #NEWLINE# #INDENT# env . threadlocal . TESTING_BROWSER = browser #NEWLINE# if ( not hasattr ( env . threadlocal , 'BROWSER' ) ) : #NEWLINE# #INDENT# env . threadlocal . BROWSER = None #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# log . start_test ( case . __name__ ) #NEWLINE# if hasattr ( module , 'before_launch_browser' ) : #NEWLINE# #INDENT# getattr ( module , 'before_launch_browser' ) ( ) #NEWLINE# #UNINDENT# if ( ( env . RESTART_BROWSER == True ) or ( env . threadlocal . BROWSER == None ) ) : #NEWLINE# #INDENT# env . threadlocal . BROWSER = launch_browser ( env . BASE_URL ) #NEWLINE# #UNINDENT# if hasattr ( module , 'before_each_testcase' ) : #NEWLINE# #INDENT# getattr ( module , 'before_each_testcase' ) ( ) #NEWLINE# #UNINDENT# case ( ) #NEWLINE# if hasattr ( module , 'after_each_testcase' ) : #NEWLINE# #INDENT# getattr ( module , 'after_each_testcase' ) ( ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# log . handle_error ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# if ( env . threadlocal . CASE_PASS == False ) : #NEWLINE# #INDENT# env . threadlocal . casepass = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# env . threadlocal . casepass = True #NEWLINE# #UNINDENT# if ( ( env . threadlocal . CASE_PASS == False ) and ( env . FAST_FAIL == True ) ) : #NEWLINE# #INDENT# log . stop_test ( ) #NEWLINE# return 'FAST_FAIL' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log . stop_test ( ) #NEWLINE# #UNINDENT# if ( env . RESTART_BROWSER == True ) : #NEWLINE# #INDENT# quit_browser ( env . threadlocal . BROWSER ) #NEWLINE# env . threadlocal . BROWSER = None #NEWLINE# #UNINDENT# if ( ( env . RESTART_BROWSER == False ) and ( env . threadlocal . BROWSER != None ) and ( env . threadlocal . casepass == False ) ) : #NEWLINE# #INDENT# quit_browser ( env . threadlocal . BROWSER ) #NEWLINE# env . threadlocal . BROWSER = None #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( env . threadlocal . BROWSER != None ) : #NEWLINE# #INDENT# quit_browser ( env . threadlocal . BROWSER ) #NEWLINE# env . threadlocal . BROWSER = None