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)
def start_excel_report_http(): m = datetime.datetime.now().strftime("%Y%m%d") basdir = os.path.abspath(os.path.dirname(__file__)) path = os.getcwd() + '\\test_case_data\\case.xlsx' listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = datacel( path) 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) 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) contec = 'dubbo接口自动化测试完成,测试通过:%s,测试失败:%s,异常:%s,未知错误:%s,详情见:%s' % ( list_pass, list_fail, list_exption, list_weizhi, filepath) send_ding(content=contec)
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)
def start(): suite = unittest.TestSuite() suite.addTest(Testinface("testinterface")) me = Testinface() list_fail, list_pass, list_json, listurls, listkeys, listconeents, listfangshis, listqiwangs, listids, listrelust, listnames = me.testinterface( ) filepath = r'C:\Users\Administrator\Desktop\jiejko\test_Report\relult.xls' if os.path.exists(filepath) is False: os.system(r'touch %s' % filepath) create(filepath, list_fail=list_fail, list_pass=list_pass, list_json=list_json, listurls=listurls, listkeys=listkeys, listconeents=listconeents, listfangshis=listfangshis, listqiwangs=listqiwangs, listids=listids, listrelust=listrelust, listnames=listnames)
def start_excel_report_http(): # m = datetime.datetime.now().strftime("%Y%m%d%H%M%S") m = datetime.datetime.now().strftime("%Y%m%d") basdir = os.path.abspath(os.path.dirname(__file__)) path = os.getcwd() + '\\test_case_data\\case.xlsx' listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = datacel(path) listrelust, list_fail, list_pass, list_json, list_exption, list_weizhi = testinterface() filepath = os.path.join(basdir + '\\test_Report\\%s-result-us.xls' % m) if os.path.exists(filepath) is False: os.system(r'touch %s' % filepath) 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) # 邮箱配置 sender = '*****@*****.**' psw = 'lovejt333' # 收件人多个时,中间用逗号隔开,如'[email protected],[email protected]' receiver = '*****@*****.**', '*****@*****.**', '*****@*****.**' # receiver_mail = {'mail': '[email protected], [email protected], [email protected]'} smtp_server = 'smtp.163.com' send_mail(sender, psw, receiver, smtp_server, filepath)
def start_excel_report_http(): m = datetime.datetime.now().strftime("%Y-%m%d-%H%M") basdir = os.path.abspath(os.path.dirname(__file__)) path = os.getcwd() + '\\data\\case.xlsx' listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = dataParsing( path) listrelust, list_fail, list_pass, list_json, list_exption, list_weizhi = caseInterface( ) filepath = os.path.join(basdir + '\\Report\\%s-result.xls' % m) if os.path.exists(filepath) is False: os.system(r'touch %s' % filepath) 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)