def start():
    starttime = datetime.datetime.now()
    mtime = datetime.datetime.now().strftime("%Y%m%d")
    basdir = os.path.abspath(os.path.dirname(__file__))

    path = os.path.join(os.path.join(os.getcwd(), 'test_case_data'),
                        'case.xlsx')
    listid, listkey, listconeent, listurl, listmethod, listqiwang, listname = datacel(
        path)
    listrelust, list_fail, list_pass, list_json, list_weizhi, listone = testinterface(
    )
    filepath = os.path.join(os.path.join(basdir, 'test_Report'),
                            '%s-result.xls' % mtime)
    if os.path.exists(filepath) is False:
        os.system(r'touch %s' % filepath)
    save_result(starttime, len(listrelust), ((list_pass)), list_fail)
    create(filename=filepath,
           list_fail=list_fail,
           list_pass=list_pass,
           list_json=list_json,
           listurls=listurl,
           listkeys=listkey,
           listconeents=listconeent,
           listfangshis=listmethod,
           listqiwangs=listqiwang,
           listids=listid,
           listrelust=listrelust,
           listnames=listname)
Exemple #2
0
def stast():
    starttime = datetime.datetime.now()
    day = time.strftime("%Y%m%d%H%M", time.localtime(time.time()))
    basdir = os.path.abspath(os.path.dirname(__file__))
    listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = datacel(
    )
    listrelust, list_fail, list_pass, list_json, list_exption, list_weizhi = testinterface(
    )
    filepath = os.path.join(basdir + '\\test_Report\\%s-result.html' % day)
    if os.path.exists(filepath) is False:
        os.system(r'touch %s' % filepath)
    save_result(starttime, len(listrelust), ((list_pass)), list_fail)
    endtime = datetime.datetime.now()
    createHtml(titles='接口测试报告',
               filepath=filepath,
               starttime=starttime,
               endtime=endtime,
               passge=list_pass,
               fail=list_fail,
               id=listid,
               name=listname,
               key=listkey,
               coneent=listconeent,
               url=listurl,
               meth=listfangshi,
               yuqi=listqiwang,
               json=list_json,
               relusts=listrelust,
               weizhi=list_weizhi,
               exceptions=list_exption)
def start():
    starttime=datetime.datetime.now()
    m=datetime.datetime.now().strftime("%Y%m%d")
    basdir = os.path.abspath(os.path.dirname(__file__))
    listid,listkey,listconeent,listurl,listfangshi,listqiwang,listname=datacel()
    listrelust, list_fail, list_pass, list_json, list_exption, list_weizhi =testinterface()
    filepath = os.path.join(basdir + '\\test_Report\\%s-result.xls'%m)
    if os.path.exists(filepath) is False:
        os.system(r'touch %s' % filepath)
    save_result(starttime, len(listrelust), ((list_pass)), list_fail)
    create(filename=filepath,list_fail=list_fail, list_pass=list_pass, list_json=list_json, listurls=listurl,
           listkeys=listkey,listconeents=listconeent, listfangshis=listfangshi, listqiwangs=listqiwang,
           listids=listid, listrelust=listrelust, listnames=listname)