You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run_excel_re.py 1.4 KiB

2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839
  1. # encoding: utf-8
  2. """
  3. @author: lileilei
  4. @file: run_excel_re.py
  5. @time: 2017/6/9 12:45
  6. """
  7. from Public.pyreport_excel import create
  8. import os, threading, datetime
  9. from testCase.case import testinterface
  10. from Public.get_excel import datacel
  11. from Public.create_report import save_result
  12. def start():
  13. starttime = datetime.datetime.now()
  14. # mtime = datetime.datetime.now().strftime("%Y%m%d")
  15. mtime = "test"
  16. basdir = os.path.abspath(os.path.dirname(__file__))
  17. path = os.path.join(os.path.join(os.getcwd(), 'test_case_data'), 'case.xlsx')
  18. listid, listkey, listconeent, listurl, listmethod, listqiwang, listname = datacel(path)
  19. listrelust, list_fail, list_pass, list_json, list_weizhi, listone = testinterface()
  20. filepath = os.path.join(os.path.join(basdir, 'test_Report'), '%s-result.xls' % mtime)
  21. if os.path.exists(filepath) is False:
  22. os.system(r'touch %s' % filepath)
  23. save_result(starttime, len(listrelust), ((list_pass)), list_fail)
  24. create(filename=filepath, list_fail=list_fail, list_pass=list_pass, list_json=list_json, listurls=listurl,
  25. listkeys=listkey, listconeents=listconeent, listfangshis=listmethod,
  26. listqiwangs=listqiwang,
  27. listids=listid, listrelust=listrelust, listnames=listname)
  28. def teThread():
  29. m = threading.Thread(target=start, args=())
  30. m.run()
  31. if __name__ == '__main__':
  32. teThread()

Introduction

生成接口测试报告

No topics

Contributors (2)