{"id":25382566,"url":"https://github.com/1103837067/pom-bdd-template","last_synced_at":"2025-04-09T13:17:51.168Z","repository":{"id":276773243,"uuid":"930248209","full_name":"1103837067/POM-BDD-template","owner":"1103837067","description":"POM-BDD-template，基于POM、BDD、playwright、allure报告的测试框架模板","archived":false,"fork":false,"pushed_at":"2025-02-10T10:27:23.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T13:17:45.679Z","etag":null,"topics":["allure-report","bdd-framework","playwright","pom","python","testing","ui-automation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1103837067.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-10T10:22:06.000Z","updated_at":"2025-02-10T10:28:32.000Z","dependencies_parsed_at":"2025-02-10T11:42:20.332Z","dependency_job_id":null,"html_url":"https://github.com/1103837067/POM-BDD-template","commit_stats":null,"previous_names":["1103837067/pom-bdd-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1103837067%2FPOM-BDD-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1103837067%2FPOM-BDD-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1103837067%2FPOM-BDD-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1103837067%2FPOM-BDD-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1103837067","download_url":"https://codeload.github.com/1103837067/POM-BDD-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045270,"owners_count":21038557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allure-report","bdd-framework","playwright","pom","python","testing","ui-automation"],"created_at":"2025-02-15T07:28:43.699Z","updated_at":"2025-04-09T13:17:51.126Z","avatar_url":"https://github.com/1103837067.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# POBDD - Playwright + pytest-bdd 测试框架\n\n基于 Playwright 和 pytest-bdd 的自动化测试框架\n\n## 特性\n\n- 使用 Playwright 进行Web自动化测试\n- 支持 BDD (Behavior Driven Development) 测试风格\n- 页面对象模式 (POM) 设计\n- 多环境配置支持\n- 详细的测试报告 (Allure)\n- 完善的日志系统\n- 异常处理机制\n- 测试数据管理\n- 支持并行测试\n- 失败重试机制\n- 截图和视频记录\n\n## 安装\n\n1. 克隆项目\n```bash\ngit clone [项目地址]\ncd POBDD\n```\n\n2. 创建虚拟环境\n```bash\npython -m venv .venv\nsource .venv/bin/activate  # Linux/Mac\n.venv\\Scripts\\activate     # Windows\n```\n\n3. 安装依赖\n```bash\npip install -r requirements.txt\nplaywright install\n```\n\n## 项目结构\n\n```\nPOBDD/\n├── config/                 # 配置文件\n├── data/                  # 测试数据\n├── pages/                 # 页面对象\n├── tests/                 # 测试用例\n├── utils/                 # 工具类\n├── reports/               # 测试报告\n└── logs/                  # 日志文件\n```\n\n## 运行测试\n\n1. 运行所有测试\n```bash\npytest\n```\n\n2. 运行特定测试\n```bash\npytest tests/steps/test_baidu_steps.py\n```\n\n3. 生成Allure报告\n```bash\npytest --alluredir=./reports/allure-results\nallure serve ./reports/allure-results\n```\n\n## 配置说明\n\n1. 环境配置\n- 修改 `config/config.py` 中的配置项\n- 支持 test/staging/prod 多环境配置\n\n2. 浏览器配置\n- 支持 chromium/firefox/webkit\n- 可配置无头模式、视窗大小等\n\n3. 测试报告配置\n- 自动截图\n- 失败重试\n- 视频录制\n\n## 开发指南\n\n1. 添加新的页面对象\n- 在 `pages/` 目录下创建新的页面类\n- 继承 `BasePage` 类\n\n2. 添加新的测试场景\n- 在 `tests/features/` 下添加 .feature 文件\n- 在 `tests/steps/` 下实现步骤定义\n\n3. 添加测试数据\n- 在 `data/` 目录下添加对应环境的数据文件\n\n## 最佳实践\n\n1. 使用页面对象模式\n2. 保持测试数据的独立性\n3. 合理使用夹具（fixtures）\n4. 编写清晰的测试步骤\n5. 及时处理和记录异常\n\n## 常见问题\n\n1. 浏览器启动失败\n- 检查 Playwright 安装\n- 确认浏览器驱动是否正确安装\n\n2. 测试报告生成失败\n- 确保 Allure 命令行工具已安装\n- 检查报告目录权限\n\n## 贡献指南\n\n1. Fork 项目\n2. 创建特性分支\n3. 提交变更\n4. 推送到分支\n5. 创建 Pull Request\n\n## 许可证\n\nMIT License ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1103837067%2Fpom-bdd-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1103837067%2Fpom-bdd-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1103837067%2Fpom-bdd-template/lists"}