简体   繁体   English

PYTEST-HTML报告测试失败

[英]PYTEST-HTML report on test fail

My question: How to generate the html report for test script when testcase fails by pytest html plugin. 我的问题:当pytest html插件在测试用例失败时,如何为测试脚本生成html报告。

As per my coverage on the topic I found this link : In this link at the bottom they have shown the image PYTEST SNAPHSOT on TEST FAIL 根据我对该主题的报道,我找到了此链接:在底部的此链接中,他们在测试失败时显示了图像PYTEST SNAPHSOT

在此处输入图片说明

So the thing is according to the documentation they are suggesting to develop a hook by which we can take screenshot of the failed test case and then attach it in jenkin email service as a report. 因此,事情是根据他们建议的文档进行的,以开发一个挂钩,通过该挂钩我们可以捕获失败的测试用例的屏幕截图,然后将其作为报告附加到jenkin电子邮件服务中。

I have tried a lot in this topic but I am not getting the right way to solve it. 在这个主题上我已经尝试了很多,但是我没有找到正确的方法来解决它。

Please suggest me complete process of writting a test script of login of facebook and failing it intentionally and capturing the snapshot of the failed test case and then attaching it to the report which is generated by PYTEST-HTML plugin. 请建议我完成以下过程:编写Facebook登录的测试脚本并有意失败,然后捕获失败的测试用例的快照,然后将其附加到由PYTEST-HTML插件生成的报告中。

Please refer this link https://github.com/linlin547/pytest_screenshots_pro 请参考此链接https://github.com/linlin547/pytest_screenshots_pro

It gives some meaningfull hint to accomplish this task. 它为完成此任务提供了一些有意义的提示。

u can use this python package link= https://github.com/seleniumbase/SeleniumBase 你可以使用这个python包link = https://github.com/seleniumbase/SeleniumBase

This package is very powerful in automation testing. 该软件包在自动化测试中非常强大。 it will auto screenshot when your pytest result is fail. pytest结果失败时,它将自动截图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM