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 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738
  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. basdir = os.path.abspath(os.path.dirname(__file__))
  16. path = os.path.join(os.path.join(os.getcwd(), 'test_case_data'), 'case.xlsx')
  17. listid, listkey, listconeent, listurl, listmethod, listqiwang, listname = datacel(path)
  18. listrelust, list_fail, list_pass, list_json, list_weizhi, listone = testinterface()
  19. filepath = os.path.join(os.path.join(basdir, 'test_Report'), '%s-result.xls' % mtime)
  20. if os.path.exists(filepath) is False:
  21. os.system(r'touch %s' % filepath)
  22. save_result(starttime, len(listrelust), ((list_pass)), list_fail)
  23. create(filename=filepath, list_fail=list_fail, list_pass=list_pass, list_json=list_json, listurls=listurl,
  24. listkeys=listkey, listconeents=listconeent, listfangshis=listmethod,
  25. listqiwangs=listqiwang,
  26. listids=listid, listrelust=listrelust, listnames=listname)
  27. def teThread():
  28. m = threading.Thread(target=start, args=())
  29. m.run()
  30. if __name__ == '__main__':
  31. teThread()

No Description

Contributors (2)