1
votes

My question: How to generate the html report for test script when testcase fails by pytest html plugin.

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

enter image description here

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.

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.

Please refer this link https://github.com/linlin547/pytest_screenshots_pro

It gives some meaningfull hint to accomplish this task.

1
PYTEST HTML plugin URL : github.com/pytest-dev/pytest-htmlVivek Tripathi

1 Answers

0
votes

u can use this python package link= https://github.com/seleniumbase/SeleniumBase

This package is very powerful in automation testing. it will auto screenshot when your pytest result is fail.