Not sure if this is by design or if it is a bug, but if you create a report with attachments like PNG images, the html HREF for those images is the full path.
This has the adverse downside of making reports unusable if you send the report to anyone as zip file, or if you even move the folder where the report and related files are located.
To reproduce:
- Create a generic report, adding a png file
extra.append(pytest_html.extras.png("c:\foo\bar\img.png", name="my cool screen")
- Once you launch the html report, it will have the image displayed correctly.
- Move the html file, the resource folder and the png file somewhere else on your machine
- Open the HTML file again
Results:
- the html file will display a broken link for the image. The tag point at the original location so as expected, the image won't display unless the PNG file is in the link location.
Not sure if this is by design or if it is a bug, but if you create a report with attachments like PNG images, the html HREF for those images is the full path.
This has the adverse downside of making reports unusable if you send the report to anyone as zip file, or if you even move the folder where the report and related files are located.
To reproduce:
extra.append(pytest_html.extras.png("c:\foo\bar\img.png", name="my cool screen")
Results: