Exemplo n.º 1
0
 def __init__(self):
     self.conf = ConfigParser.ConfigParser()
     self.__fileabspath = None
     self.__projectpath = None
     self.__logger = LogObj()
     fc = FileChecK()
     boolean = fc.is_has_file("driverpath.conf")
     if boolean:
         self.__fileabspath = fc.get_fileabspath()
         self.__projectpath = fc.getProjectPath()
     self.conf.read(self.__fileabspath)
 def __init__(self, driver):
     fc = FileChecK()
     boolean = fc.is_has_file("framework.ini")
     if boolean:
         self.projectpath = fc.getProjectPath()
         self.fwInipath = fc.get_fileabspath()
     self.conf = Config(self.fwInipath)
     self.capturePath = os.path.join(
         self.projectpath, self.conf.get("capturePath", "capturePath"))
     self.pauseTime = self.conf.get("TimeSet", "pauseTime")
     self.logger = LogObj()
     self.driver = driver
 def __init__(self):
     self.driver = None
     self.className = None
     self.beforeSuiteStarts = 0
     self.afterSuiteStops = 0
     self.beforeClassStarts = 0
     self.afterClassStops = 0
     self.beforeTestStarts = 0
     self.afterTestStops = 0
     fc = FileChecK()
     boolean = fc.is_has_file("framework.ini")
     if boolean:
         self.projectpath = fc.getProjectPath()
         self.fwInipath = fc.get_fileabspath()
     self.logger = LogObj()
     self.capturePath = os.path.join(
         self.projectpath,
         Config(self.fwInipath).get("capturePath", "capturePath"))
Exemplo n.º 4
0
def html_reporter():
    logger = LogObj()
    fc = FileChecK()
    pro_path = fc.getProjectPath()
    boolean = fc.is_has_file("framework.ini")
    if boolean:
        inipath = fc.get_fileabspath()
        fw_conf = Config(inipath)
    htmlrp_path = fw_conf.get("htmlreportPath", "htmlreportPath")
    htmreportl_abs_path = os.path.join(pro_path,htmlrp_path)
    timecurrent = DateTimeManager().formatedTime("%Y-%m-%d-%H-%M-%S")
    logger.debug("=====创建了一个html文件报告,路径是::"+htmreportl_abs_path) 
    if not os.path.exists(htmreportl_abs_path):
        os.makedirs(htmreportl_abs_path)
    file_path = str(htmreportl_abs_path)+timecurrent+"-LDP-TestingRreporter.html"
    try:
        if os.path.exists(file_path):
            html_obj = open(file_path,"a") #打开文件   追加
            return html_obj
        else:
            html_obj = file(file_path,"wb+")
            return html_obj 
    except Exception,e:
        logger.error("创建html_reporter出现错误"+str(e))