Joyhub_ui_auto_test
Python UI 自动化测试项目,基于 pytest + Playwright。
初始化
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
playwright install
copy .env.example .env
运行测试
pytest
生成测试报告
项目已配置 pytest-html,执行测试后会自动生成 HTML 测试报告:
pytest
报告存放路径:
reports\allure-results\index.html
也可以只执行指定用例并生成报告:
python -m pytest tests/test_open_chrome_browser.py
目录结构
config/ 配置读取
pages/ Page Object 页面对象
tests/ 测试用例
utils/ 通用工具
test_data/ 测试数据
reports/ 测试报告输出