Files
jiekou-python3/run_excel_re.py

40 lines
1.4 KiB
Python
Raw Normal View History

2020-05-08 18:29:34 +08:00
# encoding: utf-8
"""
@author: lileilei
@file: run_excel_re.py
@time: 2017/6/9 12:45
"""
2020-05-09 21:24:18 +08:00
from Public.pyreport_excel import create
import os, threading, datetime
2020-05-08 18:29:34 +08:00
from testCase.case import testinterface
2020-05-09 21:24:18 +08:00
from Public.emmail import sendemali
from Public.get_excel import datacel
2020-05-08 18:29:34 +08:00
from Public.create_report import save_result
2020-05-09 21:24:18 +08:00
2020-05-08 18:29:34 +08:00
def start():
2020-05-09 21:24:18 +08:00
starttime = datetime.datetime.now()
m = datetime.datetime.now().strftime("%Y%m%d")
2020-05-08 18:29:34 +08:00
basdir = os.path.abspath(os.path.dirname(__file__))
2020-05-09 21:27:02 +08:00
path = os.getcwd() + '//test_case_data//case.xlsx'
listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = datacel(path)
2020-07-09 17:45:05 +08:00
listrelust, list_fail, list_pass, list_json,list_weizhi ,listone= testinterface()
2020-05-09 21:24:18 +08:00
filepath = os.path.join(basdir + '\\test_Report\\%s-result.xls' % m)
2020-05-08 18:29:34 +08:00
if os.path.exists(filepath) is False:
os.system(r'touch %s' % filepath)
save_result(starttime, len(listrelust), ((list_pass)), list_fail)
2020-05-09 21:24:18 +08:00
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,
2020-05-08 18:29:34 +08:00
listids=listid, listrelust=listrelust, listnames=listname)
2020-05-09 21:24:18 +08:00
2020-05-08 18:29:34 +08:00
def teThread():
st = datetime.datetime.now()
m = threading.Thread(target=start, args=())
m.run()
end = datetime.datetime.now()
2020-05-09 21:24:18 +08:00
2020-05-08 18:29:34 +08:00
if __name__ == '__main__':
2020-05-09 21:24:18 +08:00
teThread()