2 Star 1 Fork 1

兰夜/frame_app_ui_PublicVersion

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
run_test.py 2.29 KB
一键复制 编辑 原始数据 按行查看 历史
行歌 提交于 2023-04-19 19:23 +08:00 . Initial commit
import os
import subprocess
import pytest
from etc import config_path, config
from tools.get_host import get_host_ip
from tools.get_log import LOGGER
from tools.push_ddmsg import DD_Msg
from tools.utility import taskkill_port, set_allure_environment
if __name__ == '__main__':
DD_Msg.send_text('消息推送 -->> web_ui_frame 程序启动')
LOGGER.info('================================ web_ui_frame 程序启动 ================================')
host = get_host_ip()
port = '2023'
path_raw = os.path.join(config_path.path_reports, 'allure-report-raw')
path_html = os.path.join(config_path.path_reports, 'allure-report-html')
pytest.main(['-s', '--reruns=0', '-n=0', fr'--alluredir={path_raw}', '--clean-alluredir'])
set_allure_environment(path=path_raw,
str_list=[f'environment={config.ENV}', 'enterprise=WSJC',
'author=panyurong', f'platformName={config.appium_platformName}',
f'platformVersion={config.appium_platformVersion}',
f'deviceName={config.appium_deviceName}', f'appPackage={config.appium_appPackage}',
f'appActivity={config.appium_appActivity}', f'noReset={config.appium_noReset}',
f'unicodeKeyboard={config.appium_unicodeKeyboard}',
f'resetKeyboard={config.appium_resetKeyboard}', f'remote={config.appium_remote}'
]) # 设置allure报告Environment信息
subprocess.Popen(fr'allure generate {path_raw} -o {path_html} --clean', shell=True)
taskkill_port(port) # 注:打开HTML报告前,关闭该端口号进程。serve或open运行时会自动打开一个java进程,多次使用会增加内存消耗,且不能在同一个端口号反复打开HTML报告,需要主动关闭历史进程
subprocess.Popen(fr'allure serve {path_raw} -p {port}', shell=True)
subprocess.Popen(fr'exit 0', shell=True)
DD_Msg.send_text(fr'消息推送 -->> web_ui_frame 测试报告:http:/{host}:{port}/index.html')
LOGGER.info('================================ web_ui_frame 程序终止 ================================')
DD_Msg.send_text('消息推送 -->> web_ui_frame 程序终止')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/panyurong/frame_app_ui_PublicVersion.git
git@gitee.com:panyurong/frame_app_ui_PublicVersion.git
panyurong
frame_app_ui_PublicVersion
frame_app_ui_PublicVersion
master

搜索帮助