Skip to content

links generated in the html file for attachments are absolute, there is no way to make them relative #309

Description

@theshinyknight

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bug.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions