# webui **Repository Path**: stonegitee/webui ## Basic Information - **Project Name**: webui - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-29 - **Last Updated**: 2025-05-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # WebUI自动化测试框架 基于Python的WebUI自动化测试框架,采用POM(Page Object Model)设计模式。 ## 技术栈 - Python 3.10+ - Selenium 4.x - Pytest 7.x - Allure 2.x - Jenkins ## 项目结构 ``` webui_auto_test/ ├── config/ # 配置文件目录 │ ├── config.ini # 全局配置文件 │ └── browser_config.py # 浏览器配置管理 ├── data/ # 测试数据目录 │ └── test_data.yaml # 测试数据文件 ├── logs/ # 日志目录 ├── page_objects/ # 页面对象目录 │ ├── base_page.py # 基础页面类 │ └── pages/ # 具体页面类 ├── test_cases/ # 测试用例目录 ├── utils/ # 工具类目录 ├── conftest.py # Pytest配置文件 └── requirements.txt # 项目依赖 ``` ## 功能特点 1. 支持多浏览器(Chrome、Firefox、Edge) 2. 自动管理浏览器驱动 3. 支持无头模式运行 4. 完善的日志系统 5. 自动截图功能 6. 支持数据驱动测试 7. 集成Allure报告 8. 支持Jenkins持续集成 ## 安装说明 1. 安装Python 3.10+ 2. 安装依赖包: ```bash pip install -r requirements.txt ``` 3. 安装Allure命令行工具 4. 配置config.ini文件 ## 运行测试 1. 运行所有测试: ```bash pytest ``` 2. 运行指定测试: ```bash pytest test_cases/test_login.py ``` 3. 生成Allure报告: ```bash pytest --alluredir=./allure-results allure serve ./allure-results ``` ## Jenkins集成 1. 安装Allure Jenkins插件 2. 配置Jenkins Pipeline 3. 设置定时任务或Git Hook触发 ## 注意事项 1. 确保浏览器版本与驱动版本匹配 2. 测试数据文件使用YAML格式 3. 页面元素定位器统一管理 4. 合理使用等待机制 5. 及时清理测试数据