修改allure html报告保存方式,保存每次执行的html报告
This commit is contained in:
2
common
2
common
Submodule common updated: d572874a99...a6beecbbd0
7
run.py
7
run.py
@@ -35,6 +35,7 @@ pytest相关参数:以下也可通过pytest.ini配置
|
||||
# 标准库导入
|
||||
import os
|
||||
import shutil
|
||||
import time
|
||||
# 第三方库导入
|
||||
import pytest
|
||||
from loguru import logger
|
||||
@@ -95,15 +96,17 @@ def run(env, m, report):
|
||||
pytest.main(args=arg_list)
|
||||
# ------------------------ 生成测试报告 ------------------------
|
||||
if report == "yes":
|
||||
_ALLURE_HTML_DIR = f"{ALLURE_HTML_DIR}_{str(int(round(time.time() * 1000)))}"
|
||||
logger.debug("ALLURE HTML DIR: {}".format(_ALLURE_HTML_DIR))
|
||||
report_path, attachment_path = generate_allure_report(allure_results=ALLURE_RESULTS_DIR,
|
||||
allure_report=ALLURE_HTML_DIR,
|
||||
allure_report=_ALLURE_HTML_DIR,
|
||||
windows_title=REPORT["项目名称"],
|
||||
report_name=REPORT["报告标题"],
|
||||
env_info={
|
||||
"运行环境": GLOBAL_VARS.get("host", None)},
|
||||
allure_config_path=ALLURE_CONFIG_DIR,
|
||||
attachment_path=os.path.join(REPORT_DIR,
|
||||
f'autotest_report.zip'))
|
||||
f'{_ALLURE_HTML_DIR}.zip'))
|
||||
# ------------------------ 发送测试结果 ------------------------
|
||||
|
||||
send_result(report_info=REPORT, report_path=report_path, attachment_path=attachment_path)
|
||||
|
||||
Reference in New Issue
Block a user