# ui_framework **Repository Path**: BruceQiang/ui_framework ## Basic Information - **Project Name**: ui_framework - **Description**: pytest+selenium+allure 实现报错截图并附加到测试报告,测试完成后发送测试报告到企业微信/邮箱 - **Primary Language**: Python - **License**: AFL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2025-12-26 - **Last Updated**: 2025-12-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ui_framework #### 介绍 selenium+pytest+allure+requests 实现报错截图并附加到测试报告,测试完成后发送测试报告到钉钉/企业微信/邮箱 #### 安装教程 1. python版本:3.8.10 2. 所需python包: - pytest - pytest-rerunfailures - pytest-xdist - selenium - email - pymysql - urllib3 - requests - allure-pytest (需要额外安装allure插件,下载地址:https://github.com/allure-framework/allure2/releases) - allure-combine #### 实现功能 1. 报错截图添加到allure测试报告 2. 失败的测试用例重新运行 3. 多线程运行 4. 测试完成发送测试报告到钉钉群/企业微信群/邮箱 #### 使用说明 1. tests目录:存放测试用例的文件夹 2. conftest.py:主要功能:定义 WebDriver在测试函数级别作用域下、报错截图并嵌入测试报告、发送测试报告到钉钉/企业微信/邮件 3. wechat_dingding_bot_api.py:企业微信和钉钉机器人api 4. web_helpers.py:简单封装了一下selenium.webdriver的部分功能 5. pytest.ini:pytest配置文件 #### 可视化测试报告示例 http://1.94.49.63:8002/ui-testreports/huaxunban_testreport/reports/complete.html