2017-06-04 15:42:30 +08:00
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
# @Author : leizi
|
2017-06-05 21:50:25 +08:00
|
|
|
|
import os,time,unittest,datetime
|
2017-06-04 20:52:17 +08:00
|
|
|
|
from Case.ceshiyongli import Testinface
|
2017-06-06 11:05:50 +08:00
|
|
|
|
from Public.py_Html import createHtml
|
2017-06-04 15:42:30 +08:00
|
|
|
|
'''
|
|
|
|
|
|
这里你可以分开执行上面你case里面包含的用例。也可以单独执行里面
|
|
|
|
|
|
的某一个的测试用例
|
|
|
|
|
|
'''
|
2017-06-04 20:52:17 +08:00
|
|
|
|
from Interface.emmail import sendemali
|
2017-06-04 15:42:30 +08:00
|
|
|
|
if __name__ == '__main__':
|
2017-06-04 20:52:17 +08:00
|
|
|
|
# suite = unittest.TestSuite()
|
|
|
|
|
|
# suite.addTest(Test_tuling("test_post4"))
|
|
|
|
|
|
# suite.addTest(Test_tuling('test_post3'))
|
|
|
|
|
|
# suite.addTest(Test_tuling('test_post2'))
|
|
|
|
|
|
# suite.addTest(Test_tuling('test_post1'))
|
|
|
|
|
|
# filedir=".\\report\\"
|
|
|
|
|
|
# filename="pyresult.html"
|
|
|
|
|
|
# filepath=filedir+filename
|
|
|
|
|
|
# if os.path.exists(filepath) is False:
|
|
|
|
|
|
# os.system(r'touch %s' % filename)
|
|
|
|
|
|
# fp=open(filepath,'wb')
|
|
|
|
|
|
# runner= BSTestRunner.BSTestRunner(stream=fp, title=u'接口测试的结果', description='这是post接口测试报告,如下')
|
|
|
|
|
|
# runner.run(suite)
|
|
|
|
|
|
# # sendemali(filepath)#这里的路径需要时需要填写路径,
|
2017-06-05 21:50:25 +08:00
|
|
|
|
starttime=datetime.datetime.now()
|
|
|
|
|
|
suite = unittest.TestSuite()
|
|
|
|
|
|
suite.addTest(Testinface("testinterface"))
|
|
|
|
|
|
me=Testinface()
|
2017-06-06 11:05:50 +08:00
|
|
|
|
list_fail, list_pass, list_json, listurls, listkeys, listconeents, listfangshis, listqiwangs, listids, listrelust, listnames=me.testinterface()
|
|
|
|
|
|
filepath =r'C:\Users\Administrator\Desktop\jiekou\\report\\relult.html'
|
2017-06-05 21:50:25 +08:00
|
|
|
|
if os.path.exists(filepath) is False:
|
2017-06-06 11:05:50 +08:00
|
|
|
|
os.system(r'touch %s' % filepath)
|
2017-06-05 21:50:25 +08:00
|
|
|
|
endtime=datetime.datetime.now()
|
2017-06-06 11:05:50 +08:00
|
|
|
|
createHtml(titles='接口测试报告',filepath=filepath,starttime=starttime,endtime=endtime,passge=list_pass,fail=list_fail,id=listids,name=listnames,key=listkeys,coneent=listconeents,url=listurls,meth=listfangshis,yuqi=listqiwangs,json=list_json,relusts=listrelust)
|
2017-06-05 21:50:25 +08:00
|
|
|
|
# fp = open(filepath, 'wb')
|
|
|
|
|
|
# runner = BSTestRunner.BSTestRunner(stream=fp, title=u'接口测试的结果', description='这是post接口测试报告,如下')
|
|
|
|
|
|
# runner.run(suite)
|
|
|
|
|
|
|
|
|
|
|
|
|