Mochawesome Reports: Jenkins blank html instead of report

In Jenkins you have added HTML publisher plugin and configured with mochawesome reports as the source on your build job, and after running your build, you would obviously expect HTML publisher to show your test results. However, Jenkins shows blank html instead of mochawesome report.

After some google search, I have found this solution on stackoverflow, which actually worked for me.
To fix this issue, navigate to Jenkins > Manage Jenkins >  Script Console
Then run the following command in console.

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP"," ")

Jenkins blank html report
Manage Jenkins page
Jenkins blank html report in script console
Script console

This is my current setup: I have setup a Jenkins job to run my cypress tests, at the end of the test run, it generates the mocahwesome html report, then html publisher will display the generated report in the browser.

Note: if you run Jenkins from a war file, whenever you restart the Jenkins server, you might lose this setting. So you need to re run above steps to see html reports.

If you know how to make Jenkins to persists these setting to avoid Jenkins blank html report, please let me know I will update my post. Thanks.

source : stackoverflow