在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
TaffyTaffy is a Test Automation Framework based on nosetests. Taffy is usesd mainly to test interface including Http, dubbo/hessian, Webservice, Socket and etc. Taffy also provided encapsulation and realized the interfaces of data check, config read, DB / redis operations, data encryption / decryption and etc. The basic useage can be found at Tests/ folder. Taffy是基于nosetests的自动化测试框架。 Taffy主要适用于服务端接口(包含且不限于Http, Dubbo/hessian, Webservice, Socket等协议)功能及性能自动化测试;也可集成Selenium, Appium进行WEB或APP的自动化测试。 Taffy同时封装实现了配置读取、数据对比、DB/Redis操作、数据加解密、正交表生成测试用例等工具类。 基本用法可以参考Tests/目录。 欢迎加入QQ群交流讨论:25452556 目录0. 更新记录20181010 v1.7 Python 3.7版本适配,现已支持Python2.7 - 3.7 20171030 v1.6 支持模块自定义配置安装,详见setup.py 20171015 v1.5 新增《Taffy入门教学视频》 20171010 v1.4 支持分布式模式运行locust 20171009 v1.3 统一配置文件格式为YAML 20170928 v1.2 集成locust,相同脚本可同时进行功能自动化及性能测试,详见附录7-1 20170922 v1.1 集成selenium,新增相关测试demo 20170920 v1.0 发布第一个版本,支持http/hessian/webservice等类型接口功能自动化测试,并提供相关Util工具类 1. 运行环境
2. 项目结构
3. 环境部署3.1 Python请根据需要下载Python 2.7或3.7版本:https://www.python.org/downloads/ 3.2 IDE推荐使用PyCharm:http://www.jetbrains.com/pycharm/ 3.3 Librequirements.txt 中存放了Taffy用到的第三方lib库,可以运行 # 默认安装全部模块$ python setup.py# -h或--help,查看帮助$ python setup.py -h 3.4 PyCharm配置
4. 测试编写执行及报告导出4.1 功能自动化测试4.1.1 测试编写taffy目前只支持nose方式编写测试用例,详见附录7-2 后续可扩展支持其他方式,如以excel,csv,yaml等数据驱动形式保存用例 4.1.2 测试执行可以使用两种方式执行功能自动化测试脚本:
在PyCharm下方Terminal终端中,输入命令执行测试: # 执行测试文件test_demo.py$ nosetests -v Tests/test_demo.py# 单独执行测试文件test_demo.py中测试类test_demo下的test_http测试方法$ nosetests -v Tests/test_demo.py:test_demo.test_http 更多nosetests运行选项,请参考nostests官方文档 4.1.3 测试报告功能自动化测试执行完成后,在Pycharm左下方Run窗口的Testing toolbar中,选择“Export Test Results”按钮即可导出测试报告 4.2 性能测试4.2.1 配置config/locust.yml4.2.2 运行locust运行test_locust.py生成locustfile及执行性能测试,命令如下: $ cd Taffy\Tests$ python test_locust.py 4.2.3 测试报告
Taffy集成locust性能测试框架使用说明,详见附录7-1 5. 参考资料6. 联络方式QQ交流群:25452556 7. 附录7.1 locust框架集成使用说明7.2 nose编写测试用例方法7.3 Jenkins集成 |
请发表评论