Ai
2 Star 24 Fork 8

陈晨/webUI自动化框架python+selenium+pytest+allure+poium+loguru

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
run.py 1.13 KB
Copy Edit Raw Blame History
陈晨 authored 2022-08-22 01:22 +08:00 . 补充多线程执行功能
# -*- coding: utf-8 -*-
import os
import time
import pytest
from shutil import copyfile
from common.config import PathConfig
from tools.date_tool.get_date import GetDate
now_time = GetDate().get_now_time("%Y-%m-%d_%H-%M_%S")
root_path = PathConfig.root_path # 项目根路径
cases_path = PathConfig.case_path # 测试用例路径
common_path = PathConfig.common_path # 公共文件路径
report_path = os.path.join(PathConfig.report_path, now_time+os.sep) # 测试报告路径
html_path = os.path.join(report_path, 'html') # 测试报告html文件夹路径
now_time = time.strftime("%Y-%m-%d %H.%M.%S", time.localtime())
def run():
pytest.main(["-v", "-s",
r"--alluredir=" + report_path,
"--clean-alluredir"])
# 复制测试环境信息到测试报告目录下
# os.mkdir(report_path)
copyfile(common_path + "environment.properties", report_path + "environment.properties")
os.system('allure generate ' + report_path + ' --clean -o ' + html_path) # -o 参数是将报告内容保存到指定的文件夹下 -c接目录,清理上次的报告数据
if __name__ == '__main__':
run()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/chen-LinQiang/ui-automation-framework.git
git@gitee.com:chen-LinQiang/ui-automation-framework.git
chen-LinQiang
ui-automation-framework
webUI自动化框架python+selenium+pytest+allure+poium+loguru
master

Search