Questions tagged [pytest-html]

pytest-html allows to generate an html report from pytest results. It is invoked via the command-line option "--html".

pytest-html is a pytest plugin which allows to generate an html report from pytest results, additionally to the xml report provided by pytest itself. It is invoked via the command-line option --html==<report-location> and can be configured via additional options and pytest hooks.

Reference:

102 questions
9
votes
1 answer

Setting dynamic folder and report name in pytest

I have a problem with setting report name and folder with it dynamically in Python's pytest. For example: I've run all pytest's tests @ 2020-03-06 21:50 so I'd like to have my report stored in folder 20200306 with name report_2150.html. I want it to…
MrTeatime
  • 183
  • 1
  • 6
5
votes
1 answer

How to capture the log details on pytest-html as well as writing in to Console?

In my pytest script, I need to customize the pytest-HTML report for capturing the stdout at the same time writing into the console as I have user input in my automated test. test_TripTick.py import os import sys import pytest from Process import…
Raj
  • 151
  • 1
  • 14
4
votes
2 answers

Pytest HTML Not Displaying Image

I am trying to generate a self contained html report using pytest-html and selenium. I have been trying to imbedded screenshots into the report but they are not being displayed. My conftest.py looks like this @pytest.fixture() def…
cdub
  • 330
  • 4
  • 19
4
votes
1 answer

How to embed base64 image in HTML using pytest-html?

I am using python-appium client and generating a HTML report after the tests are finished. I would like to add the embedded images of the failure tests in the HTML report. The reason to embed the image is that I can access it from the remote machine…
Psdet
  • 659
  • 9
  • 24
4
votes
3 answers

How to share html report of pytest-html with out changing the css

I am using python 3.6 and pytest-html to generate HTML reports . Everything is successfully working but when i share my html report to my manager the css of the entire document is out of placed .can someone tell the reason to why it is happening and…
manoj
  • 121
  • 3
  • 14
3
votes
1 answer

Disable printing of log output on console using pytest

I am writing tests using pytest and if my validation fails it generates a lot of logs which is needed. I am using the python's standard logging module to log these errors to a file using FileHandler class. I am using pytest-html to generate the html…
Saurabh Rai
  • 45
  • 1
  • 6
3
votes
2 answers

How do i make all rows of pytest-html single html report result file default to a collapsed state?

I use the pytest runner to get the output of results from my automated test frameworks (Selenium and RestAPI tests). I use the pytest-html plugin to generate a single page html result file at the end of the test. I initiate the test run with the…
Roochiedoor
  • 887
  • 12
  • 19
3
votes
3 answers

How could I use pytest-html in Pycharm?

I have installed pytest-html and want to use it generate html report after run pytest in pycharm. like this: but it pops error: ERROR: file not found: html=report\result.html after run. So how to modify the arguments?
Harjeb
  • 105
  • 2
  • 9
3
votes
1 answer

How does Atlassian Bamboo recognise python pytest reports

I have some Integration tests written in Python3 using pytest. I am using pytest-html to generate an html report from it. How can I make Bamboo recognize/show this report.
Rahul
  • 177
  • 1
  • 3
  • 12
2
votes
1 answer

pytest-html extras customizing code understanding

I'm trying to customize report.html of pytest using pytest-html plugin. I searched up many sites(including pytest-html documentation) and found that the code below is commonly used.(The code is in…
jaemmin
  • 341
  • 1
  • 12
2
votes
1 answer

Pytest-html: Customize report title based on marks

I want to indicate the pytest test execution marks in the pytest-html report title I am trying the approach as shown below. It does not work. conftest.py #add test execution mark as a 'label' field to the…
Anatoliy Sakhno
  • 146
  • 1
  • 7
2
votes
1 answer

Adding new field to TestReport object and using it in pytest_html_results_table_html hook

I want to get information about exceptions raised during test call phase and add them to report created with pytest-html plugin. So I created hookwrapper for pytest_runtest_makereport: @hookimpl(hookwrapper=True) def…
Beder123
  • 59
  • 4
2
votes
1 answer

Pytest: captured stderr setup and captured log setup duplicated

As shown on the screenshot above: my pytest-html report gives me both "Captured stdout setup" and "Captured log setup" when driver instance is created. Is there a way to turn it off so it's not redundant? -----------------------------Captured…
2
votes
0 answers

How to display pytest warnings in the generated HTML report?

I'm using pytest and pytest-html to generate reports. Having just found out about warnings, I'd like to have the warnings that I generate in tests with warnings.warn(UserWarning(f'Whoops!')) be shown somewhere in the generated HTML test report. At…
Ed King
  • 1,833
  • 1
  • 15
  • 32
2
votes
0 answers

Pack pytest with pytest_html module using pyinstaller

I am having an issue to pack pytest with pytest_html module to an executable using pyinstaller On Windows. When running it with Python it does work, but I need to pack it as exe. My example code: import pytest import pytest_html def test_hello(): …
NathanK
  • 21
  • 1
1
2 3 4 5 6 7