1 Star 9 Fork 2

limusen/PythonSelenium-Unittest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
limusen 提交于 2022-01-11 14:39 . 修改chrome option02
# -*- coding: utf-8 -*-
# @Time : 2021/12/22 14:13
# @Author : Limusen
# @File : main
"""
测试用例的运行入口
"""
import os
import unittest
from common.config_utils import local_config
from common import HTMLTestReportCN
current = os.path.dirname(os.path.abspath(__file__))
case_path = os.path.join(current, local_config.case_path) # 在ini文件写入测试用例地址
report_path = os.path.join(current, local_config.report_path) # 在ini文件写入测试报告地址
def load_api_case():
discover_obj = unittest.defaultTestLoader.discover(start_dir=case_path,
pattern='test_login.py')
all_case_suite = unittest.TestSuite()
all_case_suite.addTest(discover_obj)
return discover_obj
if __name__ == '__main__':
# 创建网页版报告路径的对象
report_path_obj = HTMLTestReportCN.ReportDirectory(report_path)
# 创建报告
report_path_obj.create_dir("UI测试报告")
# 获取网页版报告的路径
html_report_obj = HTMLTestReportCN.GlobalMsg.get_value("report_path")
# print(html_report_obj)
html_report_file_obj = open(html_report_obj, 'wb')
runner = HTMLTestReportCN.HTMLTestRunner(stream=html_report_file_obj,
tester="limusen",
description="ui测试框架报告")
runner.run(load_api_case())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/todayisgoodday/PythonSelenium.git
git@gitee.com:todayisgoodday/PythonSelenium.git
todayisgoodday
PythonSelenium
PythonSelenium-Unittest
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385