By default Content Security Policy (CSP) in Jenkins does not allow Cucumber HTML reports to be shown correctly, with styles, embedded images and JS. To fix that one need to relax CSP rules.
In my case, Jenkins is hosted on Ubuntu, so config file is here: /etc/default/jenkins
.
CSP settings should be passed via JAVA_ARGS. Just add the following next to your current JAVA_ARGS settings and then restart Jenkins.
JAVA_ARGS="$JAVA_ARGS -Dhudson.model.DirectoryBrowserSupport.CSP=\"sandbox allow-scripts; default-src 'unsafe-inline'; img-src *\""
To be fair, img-src *
shouldn't be necessary, because obviously I'm hosting embedded images next to report itself.
But for some reason img-src 'self'
didn't work for me. At least for Safari.