Exemplo n.º 1
0
 def __init__(self, excelfilename):
     self.excelfilename = excelfilename
     fc = FileChecK()
     boolean = fc.is_has_file(excelfilename)
     if boolean:
         self.excel_path = fc.get_fileabspath()
     self.logger = LogObj()
def RunBrowser(baseURL):
    fc = FileChecK()
    boolean = fc.is_has_file("RunWhichBrowser.ini")
    if boolean:
        rwb_ini_path = fc.get_fileabspath()
    conf = Config(rwb_ini_path)
    runBrowser = conf.get("run", "browser")
    LogObj().debug("======本次试用%s浏览器进行测试======" % runBrowser)
    driver = WebDriverDoBeforeTest().getDriverTooler(runBrowser, baseURL)
    return driver
Exemplo n.º 3
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
Exemplo n.º 5
0
    def __init__(self):
        fc = FileChecK()
        boolean = fc.is_has_file("framework.ini")
        if boolean:
            rwb_ini_path = fc.get_fileabspath()
        conf = Config(rwb_ini_path)
        baseURL = conf.get("baseURL", "baseURL")
        self.driver = RunBrowser(baseURL)

        self.driverapi = WebdriverApi(self.driver)
        self.logger = LogObj()
        self.basecase = WebDriverDoBeforeTest()
        self.basecase.driver = self.driver
Exemplo n.º 6
0
 def __init__(self):
     self.fc = FileChecK()
     bools = self.fc.is_has_file("email.ini")
     if bools:
         fp = self.fc.get_fileabspath()
         conf = Config(fp)
         self.smtp_host = conf.get("emails", "smtp_host")
         self.pop3_host = conf.get("emails", "pop3_host")
         self.receiver = conf.get("emails", "receiver").split(",")
         self.receiver_pa = conf.get("emails", "receiver_pa")
         self.sender = conf.get("emails", "sender")
         self.sender_pa = conf.get("emails", "sender_pa")
     self.logger = LogObj()
Exemplo n.º 7
0
    def __init__(self):

        self.__GBD = GetBrowserDriver()
        self.__logger = LogObj()
        self.driver = None
        fc = FileChecK()
        boolean = fc.is_has_file("framework.ini")
        if boolean:
            self.inipath = fc.get_fileabspath()

        self.fw_conf = Config(self.inipath)
        self.waitTimeout = self.fw_conf.get("TimeSet", "waitTimeout")
        self.scriptTimeout = self.fw_conf.get("TimeSet", "scriptTimeout")
        self.pageLoadTimeout = self.fw_conf.get("TimeSet", "pageLoadTimeout")
Exemplo n.º 8
0
 def __init__(self):
     self.logger = LogObj()
     self.fc = FileChecK()
     boolean = self.fc.is_has_file("db.ini")
     if boolean:
         self.inipath = self.fc.get_fileabspath()
     self.conf = Config(self.inipath)
     self.host = str(self.conf.get("dbset", "host"))
     self.port = int(self.conf.get("dbset", "port"))
     self.user = str(self.conf.get("dbset", "user"))
     self.passwd = str(self.conf.get("dbset", "passwd"))
     self.db = str(self.conf.get("dbset", "db"))
     self.charset = str(self.conf.get("dbset", "charset"))
     self.conn = MySQLdb.Connect(self.host, self.user, self.passwd, self.db,
                                 self.port, self.charset)
     self.logger.debug("数据库初始化完成" + self.host + str(self.port) + self.db +
                       self.charset)
 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.º 10
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)) 
Exemplo n.º 11
0
# -*- coding:UTF-8 -*-
'''
Created on 2016年5月12日

@author: jayzhen
'''

from com.framework.util.FileCheckAndGetPath import FileChecK
from com.framework.util.ConfigCommonManager import Config

fc = FileChecK()
b = fc.is_has_file("email.ini")
if b:
    fp = fc.get_fileabspath()

    c = Config(fp)

    cc = c.get("emails", "receiver")

    print cc
    ee = cc.split(",")
    print type(ee)
    print type(cc)