Ejemplo n.º 1
0
    def __define_run_pc(self, test_cases):
        result = False
        executer = RunXlsxDpcData(test_cases, debug=tracer.debug)
        status = executer.start()
        for fs, caseid in status:
            test_result = executer(self.module).queue(fs)

            if not pub.judgement(test_result[0], test_result[1], caseid):
                break
            result = p_env.CASE_PASS
        print self.ENDTAG
        return result
Ejemplo n.º 2
0
 def start_run(self,mname, caseid = None):
                    
     if isinstance(mname, types.ModuleType):
         module = mname
     else:
         module = __import__(mname)
     
     test_cases = {}
     if caseid:
         case = self.testSet.get(caseid)
         if not case:
             print "Warning: do not hava case-> %r" %caseid                
             return
         test_cases[caseid] = case
     else:
         test_cases = self.testSet
     
     self.executer    = RunXlsxDpcData(test_cases, debug = tracer.debug)
     status = self.executer.start()        
     for fs,caseid in status:
         self.itemrst = (caseid,None)            
         test_result = self.executer(module).queue(fs)
         
         if not pub.judgement(test_result[0], test_result[1], caseid):
             self.itemrst = (None,False)
             break
         
         if not caseid:                
             self.itemrst = (caseid,p_env.CASE_PASS)
Ejemplo n.º 3
0
 def start_run(self, mname, caseid = None):
     if isinstance(mname, types.ModuleType):
         module = mname
     else:
         module_names = {"web":"UIWeb","pc":"UIPc","pad":"UIPad","key":"KeyClasses"}
         if not mname in module_names:
             raise Exception("Need specify web/pc/pad/key. not '%s'" %mname)
         module = __import__(module_names.get(mname))
     
     test_cases = {}
     if caseid:
         case = self.testSet.get(caseid)
         if not case:
             print "Warning: do not hava case-> %r" %caseid                
             return
         test_cases[caseid] = case
     else:
         test_cases = self.testSet
     
     self.executer    = RunXlsxDpcData(test_cases, debug = tracer.debug)
     status = self.executer.start()        
     for fs,caseid in status:
         self.itemrst = (caseid,None)              
         test_result = self.executer(module).queue(fs)
         
         if not judgement(test_result[0], test_result[1], caseid):
             self.itemrst = (None,False)
             break
         
         if not caseid:                
             self.itemrst = (caseid,p_env.CASE_PASS)
Ejemplo n.º 4
0
class SdRunner:
    def __init__(self,section, debug = False):
        self.itemrst = None
        
    def set_feature(self, test_excel_name, **kwargs):
        feature_driver = de.DataDriverMap(os.path.join(p_env.CASE_PKG_PATH, test_excel_name), **kwargs)
#         feature_driver = DataDriverMap(os.path.join(p_env.DATA_PATH, test_excel_name), **kwargs)
        self.testFeature = feature_driver.getDetailFeature()       
        self.testSet = feature_driver.getMapDataFeature()
                                
    def start_run(self,mname, caseid = None):
                       
        if isinstance(mname, types.ModuleType):
            module = mname
        else:
            module = __import__(mname)
        
        test_cases = {}
        if caseid:
            case = self.testSet.get(caseid)
            if not case:
                print "Warning: do not hava case-> %r" %caseid                
                return
            test_cases[caseid] = case
        else:
            test_cases = self.testSet
        
        self.executer    = RunXlsxDpcData(test_cases, debug = tracer.debug)
        status = self.executer.start()        
        for fs,caseid in status:
            self.itemrst = (caseid,None)            
            test_result = self.executer(module).queue(fs)
            
            if not pub.judgement(test_result[0], test_result[1], caseid):
                self.itemrst = (None,False)
                break
            
            if not caseid:                
                self.itemrst = (caseid,p_env.CASE_PASS)
    
    def get_dcase(self,caseid):
        test_cases = {}
        if caseid:
            case = self.testSet.get(caseid)
            if not case:
                print "Warning: do not hava case-> %r" %caseid             
                return
            test_cases[caseid] = case
        else:
            test_cases = self.testSet
        return test_cases
Ejemplo n.º 5
0
class SdRunner:
    def __init__(self,section, debug = False):
        self.itemrst = None
        
    def set_feature(self, test_excel_name, **kwargs):
        feature_driver = DataDriverMap(os.path.join(p_env.CASE_PKG_PATH, test_excel_name), **kwargs)
#         feature_driver = DataDriverMap(os.path.join(p_env.DATA_PATH, test_excel_name), **kwargs)
        self.testFeature = feature_driver.getDetailFeature()       
        self.testSet = feature_driver.getMapDataFeature()
    
    def start_run(self, mname, caseid = None):
        if isinstance(mname, types.ModuleType):
            module = mname
        else:
            module_names = {"web":"UIWeb","pc":"UIPc","pad":"UIPad","key":"KeyClasses"}
            if not mname in module_names:
                raise Exception("Need specify web/pc/pad/key. not '%s'" %mname)
            module = __import__(module_names.get(mname))
        
        test_cases = {}
        if caseid:
            case = self.testSet.get(caseid)
            if not case:
                print "Warning: do not hava case-> %r" %caseid                
                return
            test_cases[caseid] = case
        else:
            test_cases = self.testSet
        
        self.executer    = RunXlsxDpcData(test_cases, debug = tracer.debug)
        status = self.executer.start()        
        for fs,caseid in status:
            self.itemrst = (caseid,None)              
            test_result = self.executer(module).queue(fs)
            
            if not judgement(test_result[0], test_result[1], caseid):
                self.itemrst = (None,False)
                break
            
            if not caseid:                
                self.itemrst = (caseid,p_env.CASE_PASS)