I have installed pytest-html and want to use it generate html report after run pytest in pycharm.
but it pops error:
ERROR: file not found: html=report\result.html
after run. So how to modify the arguments?
I have installed pytest-html and want to use it generate html report after run pytest in pycharm.
but it pops error:
ERROR: file not found: html=report\result.html
after run. So how to modify the arguments?
use
--html=Reports/Report.html --self-contained-html
in additional argument section of pycharm
If your using terminal to run the test try this instead this will work .
py.test --html=demoreport.html
If you want to run via pycharm, just by Right click on the project, follow below steps:
Then after, Create a new file pytest.ini in the root folder of the project and provide the below values:
[pytest]
addopts = --html=reports/Report.html
python_files = tests/*.py
where, tests/*.py is a folder which contains all tests.
Now, just right click on your project and select Run 'pytest in ProjectFolderName' and you will find that report is created inside reports folder with name Report.html