Most of you might
have observed that while we set up and execute our automation script using
Jenkins. In Jenkins Dashboard UI of Extent report comes as broken
something like below screenshot:
To know how to set up the extent report in Jenkins. Please refer to this blog.
This
is one of the common issue that most of us will face while setting up extent report
in Jenkins for the very first time.
This
happens because of 'Content-Security-Policy' of Jenkins which is
introduced in from v1.641, which is blocking the inline CSS, JS Ajax resources
to load.
To know more about
Jenkins Content-Security-policy. Please click on this link.
The solution to this issue is actually quite simple. We need to make sure that we
start Jenkins server with below command
java
-Dhudson.model.DirectoryBrowserSupport.CSP="" -jar jenkins.war
After our Jenkins
server is up and running. Now when we go and execute our automation script
extent report will get properly displayed.
Is there a solution for distorted extent report.
ReplyWe have our testing suite which runs for around 7 to 8 hours, and after that the html report it generates is kind of distorted and unable to view all scenarios.
If I understood correctly there are small icons appear in report instead of actual data. The reason for that is those CSS are typically blocked on coperate network.
ReplyWhat happens actually is the html report we get its feature section is filled with the scenario section details like given..., when..., then... and the scenario Outline section has the details of Features section. and that too are incomplete.
ReplyI guess if CSS blocking was the reason then every time we would have got the distorted extent report, but in our case sometimes we get the proper report and sometimes distorted. Its kind of intermittent.
But now the frequency of getting distorted report have increased and impacting us very badly.
Our framework is designed in a way to support parallel execution. Would this be the reason for the scrambled report?
Means while we do flush() multiple test result execution are getting flushed at same time and this might be causing the report to get scrambled.
Please let us know with any approach that we can go ahead and work on fixing it. Even multiple approaches would be helpful.
We got extent report shown properly, but UI clickable actions are not working, when on clicking Failed tests / any individual test from left pane no action is performed, what was the issue/fix?, thanks!
ReplyYou can use this as well:
ReplySystem.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts; default-src 'self'; script-src * 'unsafe-eval'; img-src *; style-src * 'unsafe-inline'; font-src *");
I am getting report properly when opening in my browser , but my requirement is to send that report in email. Any suggestions how i can do that. I have tried saving the report as html, but the page is distorted.
ReplyHi Ankur ,
ReplyHow to fix the broken images in report , the images are shown perfectly in local , however in jenkins , screenshots are available under the screenshots folder , however the extent report shows broken image.
Thanks Ankur
Reply