Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48056

Published html report generated by ANT's <junitreport> task loses formatting.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • htmlpublisher-plugin
    • None
    • Jenkins 2.88

      My job is  running an ANT script which contains a JUnit task followed by a junitreport task. The junitreport task is set to generate a no-frames html report, which is then published through the HTML Publisher plugin.
      After being published, the report loses all of its pretty CSS formatting, and the javascript which is the part of the html report is not working. Also does not work if I open it from the workspace; only displays correctly when I open it as a local file. 

      See attached screenshots (published report, the report shown from the workspace and the report opened as a local file - only the latter is correctly displayed).
      The file itself is also attached, to give an example of what the ANT junitreport task typically generates as html.

          [JENKINS-48056] Published html report generated by ANT's <junitreport> task loses formatting.

          This will be related to the Content Security Policy. You will need to set a system property with specifications of what to allow. (You can see the errors if you see the console of the browser when you go to the page). Note any change to the Content Security Policy requires a rebuild of the job and it won't fix any existing HTML reports. See https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy for details.

          Richard Bywater added a comment - This will be related to the Content Security Policy. You will need to set a system property with specifications of what to allow. (You can see the errors if you see the console of the browser when you go to the page). Note any change to the Content Security Policy requires a rebuild of the job and it won't fix any existing HTML reports. See https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy  for details.

          Worked as per the info on the link, thanks!

          Victor Dulepov added a comment - Worked as per the info on the link, thanks!

            Unassigned Unassigned
            vicd Victor Dulepov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: