# -*- coding: UTF-8 -*-import unittest,sysfrom BeautifulReport import BeautifulReport as bffrom utest import datadrivenfrom common import configfrom common.mysql import Mysqlfrom common import logger# 运行的相对路径path = '.'# 用例路径casepath = ''resultpath = ''if __name__ == '__main__':# unittest.main()# suite = unittest.TestSuite()# suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(testWeb))# suite = unittest.defaultTestLoader.discover(".", pattern="baidu.py", top_level_dir=None)# # 生成执行用例的对象# runner = bf(suite)# runner.report(filename='./test.html', description='这个描述参数是必填的')try:casepath = sys.argv[1]except:casepath = ''# 为空,则使用默认的if casepath == '':casepath = path + '/lib/SOAP.xls'resultpath = path + '/lib/结果-SOAP.xls'else:# 如果是绝对路径,就使用绝对路径if casepath.find(':') >= 0:# 获取用例文件名resultpath = path + '/lib/结果-' + casepath[casepath.rfind('\\') + 1:]else:logger.error('非法用例路径')config.get_config(path + '/lib/conf.properties')# logger.info(config.config)mysql = Mysql()mysql.init_mysql(path + '/lib/userinfo.sql')datadriven.getparams(casepath,resultpath)# print(datadriven.alllist)# unittest.main()# suite = unittest.TestSuite()# suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(baidu))suite = unittest.defaultTestLoader.discover("./utest/", pattern="WebTest.py", top_level_dir=None)# 生成执行用例的对象runner = bf(suite)runner.report(filename='./test.html', description=datadriven.title)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。