博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[python]Pytest+selenium+git+jenkins持续集成
阅读量:4619 次
发布时间:2019-06-09

本文共 581 字,大约阅读时间需要 1 分钟。

1安装pytest框架

 &pip install pytest   #pytest

 &pip install pytest-html  #pytest html测试报告

 

2.工程介绍

不写怎么用pytest写自动化,可参考

&增加Pyunit这里是单元测试框架方法(用例执行)

&report用来写调试时生成的测试报告

&基于给robot写的库改下testWeb.py实际结果和预期结果的return

只需return出False和True,框架直接用assert断言最后返回是否为True即可

3.jenkins配置集成

&根据进行改动,只需要改下批处理执行,先cd 到git拉下来的目录,然后py.test --html=’生成的log路径

注:只需要改下就好 ,还有邮件 模板需要改下详细报告,这个再下面讲 其他和robot一致

 

4.发送测试报告--通用html报告

 pytest测试报告 Jenkins通用html报告

&构建生成的report同样到指定的目录

 

 

&构建后配置—HTML REPORT

 

 

&构建完看项目生成的html

&进去会发现report在这个路径,那么配置里需改下发送邮件详细报告的地址,给这个url即可

&发送邮件中测试报告url修改下:

 

 

转载于:https://www.cnblogs.com/Jack-cx/p/9359244.html

你可能感兴趣的文章
iOS手写签批
查看>>
for...in... 循环 处理一组按钮的选中状态变动
查看>>
python 函数(function)、函数(def)、函数(return)
查看>>
Python 总结题目
查看>>
Gym100212C Order-Preserving Codes
查看>>
TC1570 DesertWind
查看>>
ARC076F Exhausted
查看>>
TC10738 TheContest
查看>>
bzoj4754 [JSOI2016]独特的树叶
查看>>
多校2019 Contest 2 hdu6602 Longest Subarray
查看>>
CF277D Google Code Jam
查看>>
Redis相关面试题
查看>>
LeetCode 1101. The Earliest Moment When Everyone Become Friends
查看>>
LeetCode 1135. Connecting Cities With Minimum Cost
查看>>
LeetCode 1102. Path With Maximum Minimum Value
查看>>
LeetCode 1061. Lexicographically Smallest Equivalent String
查看>>
LeetCode 841. Keys and Rooms
查看>>
LeetCode 1043. Partition Array for Maximum Sum
查看>>
LeetCode 923. 3Sum With Multiplicity
查看>>
LeetCode 750. Number Of Corner Rectangles
查看>>