# web-ui-po **Repository Path**: ghy250/web-ui-po ## Basic Information - **Project Name**: web-ui-po - **Description**: 基于python+selenium的po设计模式的自动化框架 - **Primary Language**: Python - **License**: MulanPSL-2.0 - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2024-10-04 - **Last Updated**: 2025-07-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: Selenium, 自动化, Allure ## README # web-ui-po #### 框架介绍 python+selenium+jenkins+allure的po设计模式的web自动化框架 #### 核心目录说明 1. element:元素层,存放操作对象的目录,此处的代码是根据data/ele.xlsx的文件自动生成,具体方法在common目录下 2. common:公共方法;如日志方法、基础类 3. data:目前存放了一个元素的excel,所有元素再此维护;框架提供了通过excel生成元素层代码的方法 4. module:业务层;复杂的业务操作以及重复率较高的操作将在此封装方法 5. test_case:用例层;测试用例编写处 6. tools:工具包目录;第三方工具均存与此目录.例如OCR/Allure/jenkins等等 7. config:配置目录;用于存放环境参数,如系统账号、数据库链接账号等 #### 框架搭建 1. 安装jdk11+ 2. 安装allure 3. 安装jenkins 4. 安装OCR 5. 安装python3.11+ 6. 创建python项目(建议用虚拟环境) 7. 安装插件: pip install -r requirements.txt #### 测试网站Redmine的安装和部署(详情:https://baijiahao.baidu.com/s?id=1793852473085913730&wfr=spider&for=pc) 1. 下载并安装oracle virtualBox(虚拟机) 2. 下载redmine镜像 3. 运行虚拟机启动镜像 #### 使用说明 1. 本地运行: 1. 进入项目根目录,命令行执行: pytest --alluredir ./report/allure-data/ 2. 查看allure报告: allure serve ./report/allure-data/ 2. jenkins构建: 1. 将默认的jenkins windows服务禁用 2. 制作jenkins war包启动方式(如果坚持使用windows服务启动jenkins的方式,将无法看到浏览器操作,因为它是后台运行) 3. 构建合适的流水线(主要是配置git、allure和pytest运行命令) 4. 运行流水线 #### allure报告展示 ![Image text](https://gitee.com/ghy250/web-ui-po/raw/develop/report/allure1.png) ![Image text](https://gitee.com/ghy250/web-ui-po/raw/develop/report/allure2.png) ![Image text](https://gitee.com/ghy250/web-ui-po/raw/develop/report/allure3.png) ![Image text](https://gitee.com/ghy250/web-ui-po/raw/develop/report/allure4.jpg)