pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

how can i realize append html result other than overwrite html result?

Open lp120037920 opened this issue 4 years ago • 6 comments

now I run 2 commmands:

pytest test1.py --html=report.html pytest test2.py --html=report.html

finally, the second runned command which generate report.html will overwrite the first generated report.html, but i hope the two result can merged, that means report.html include test1.py and test2.py result, could you tell me how i can do that?thank you very much

lp120037920 avatar Feb 02 '21 07:02 lp120037920

hello @lp120037920

your question might be related to #183. could you check if https://github.com/pytest-dev/pytest-reportlog solves your problem?

jkowalleck avatar Feb 02 '21 20:02 jkowalleck

@jkowalleck if i use that plugin, finall, i get json file, but the html file is what i want, what further step should i do to get html file? json2html?

lp120037920 avatar Mar 10 '21 06:03 lp120037920

@BeyondEvil could you help out here?

jkowalleck avatar Mar 10 '21 08:03 jkowalleck

@jkowalleck @BeyondEvil i install pytest-reportlog and json2html,firstly, the json result is not merged,it is separately, secondly,json2html's resulst is totally different from pytest --html=report.html result,it is mess, can not be readed for hunman

lp120037920 avatar Mar 10 '21 08:03 lp120037920

There's not native way of merging two reports.

Either you run the tests in the same session or you have to find or write a utility that takes two html-reports and merges them.

I'm adding this as a feature request for V3 (which doesn't necessarily mean it will be implemented).

BeyondEvil avatar Mar 10 '21 08:03 BeyondEvil

@lp120037920 what i did in the past, to merge multiple reports: https://github.com/pytest-dev/pytest-html/issues/183#issuecomment-738195470

but you might not see all the details pytest-html offers. you might probably miss environment variables and other features.

jkowalleck avatar Mar 10 '21 16:03 jkowalleck