框架使用python自带的unittest。ddt数据驱动;Excel管理测试用例、yaml管理测试页面元素,并对selenium API进行了封装,简化代码量同时记录log
- case.xlsx 测试数据
- page_data.yaml 页面对象数据
- send_email.py 邮件发送模块
- testsuite.py 测试用例集
- modules 第三方模块(ddt.py、HTMLTestRunner_cn.py)
- gettestdata.py 获取测试数据模块
- log.py 日志模块
- selse_feng.py 封装selenium方法
环境部署
- 在项目根目录下执行pip install -r requirements.txt 具体说明参考:https://www.jianshu.com/p/2cbc4fa7dbe3
- ddt驱动如果需要读自定义测试用例名称的名字需要修改ddt.py (数据驱动源码) 参考:https://www.jianshu.com/p/d1d22e6a655d
注意:如果ide导入模块失败,可以在命令行pip安装,命令如下
- 升级pip: python -m pip install --upgrade pip(提示Could not find a version that satisfies the requirement yaml (from versions: ) No matching distribution found for yaml 时候使用)