pytest使用allure生成测试报告的2种命令


pytest中使用allure生成测试报告有两种命令方式:

1.第一种(推荐):

第一步:输入下面的命令,执行pytest生成allure的json结果文件:

pytest test_cals.py --alluredir ./report

第二步:输入下面的命令生成html文件并启动一个服务,通过访问链接浏览html报告:

allure serve ./report

  

2.第二种:

第一步:输入下面的命令,执行pytest生成allure的json结果文件:

pytest test_cals.py --alluredir ./report

第二步:生成html文件,文件存放路径为【./allure-report/】

allure generate ./report/

第三步:启动一个服务,通过访问链接浏览html报告:

allure open ./allure-report/

 

总结:使用第一种,命令断,而且两个命令的报告文件路径保持一样

第二种可以看到其中allure open的后面的html文件路径和allure json路径不一致,容易搞混

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM