-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report displayed incorrectly when displayed non-locally due to CSR problems #422
Comments
Hey @kriegaex: 👋 - Thanks for helping to make the reporter better by raising this ticket. I will take a look as soon as I can and get back to you. Cheers, Danny. |
For some reason, I see GitHub uploading my screenshots, but then they vanish and are not attached to the issue. I never experienced such a problem with inline screenshots before. |
Hey @kriegaex This sounds similar to an issue that people were seeing a while ago with Jenkins. Here a link to the solution that one user found: This is more of a Jenkins issue than something specific to the reporter. |
Yes, that is the same problem, @DannyDainton. Thanks for the hint. It actually seems to be a Jenkins problem, but I am not sure if I can get it resolved within our organisation for all our hundreds of Jenkins instances on OpenShift. For now, I have no alternative URL for my Jenkins instance, which I could use as a resource URL. If there was an alternative way to optionally generate the reports in a way that would work on any Jenkins instance, or more generically, any server (also non-Jenkins) instance with a CSP (content security policy) in place, by rendering HTML not relying on external CSS but embedding all necessary resources directly into the generated HTML file, even at the expense of bigger files with redundant information, that would be great. I think, you can easily test that by downloading the current Jenkins WAR, running it localy and creating a simple scripted or pipeline Jenkins build, attaching a sample report to the build manually. That way, you could dramatically enlarge your user base in enterprise environments with CSPs in place and without readily available resource URLs. |
Just putting it out there, I'm not going to be spinning up any Jenkins instances to test that. You could do all that you want to do, in a template file. The reporter runs from a single generic template that presents the data in the way that you seen it in the final report. The reporter takes in a custom template file using the https://github.com/DannyDainton/newman-reporter-htmlextra/blob/main/lib%2Fdashboard-template.hbs You could get the raw responses from all the css and js CDNs and paste those directly into a new template file. Then run your Collection's using that. |
@DannyDainton, Jenkins is just an example for any website sporting a CSP. I just suggested Jenkins, because it has one in place by default, is setup locally in 5 minutes by just running I am sure what you said about templates is correct. I have no idea how those templates work, speak next to no CSS and no JS at all. I am a Java guy. Maybe I can get it done with some pointers, but what I was striving for when opening this issue was an improvement for all users who happen to generate reports on sites with CSPs in place. If they could just set a reporting option in newman for your custom reporter, it would be easier. The leverage would be much bigger for you to reach the users than by forcing every single one of them to do what you just suggested to me. Creating a custom template, IIUC, would also mean that I would have to re-do that after upgrading your plugin to match the external CSS versions you are referencing from there. The thing is, I do not even notice version changes, because npm simply pulls the latest one into my Docker container. It is meant to run in a "touch once, (next to) never change" mode. If you would deliver two templates - the current one and a big one inlining all the other CSS files - and let the user switch using an option, probably it would solve the problem described here and in the other issue you linked to before. If it is just about the download and 5 minutes to set up Jenkins for you, I will gladly volunteer to test the new version, once it is out or if you can instruct me how to pull a test version via npm. (You are guessing correctly, I am not just a JS noob but a node.js and npm one to boot.) |
Like I said, this is something to be done during a tool's build process automatically, not something I want to customise and cut off myself from future updates. Anyway, I tried manually, and it still does not work as expected, probably due to JS, see here:
Before after almost 1.5 years I left my customer last week - I have no more access to their environment - I already told them to set up a resource root URL for Jenkins, which will solve the problem. I tried locally. I hope they have done that in my absence. |
If you have a custom template created, that's always going to render that if you use that in the execute command. Even if the underlying reporter changed or the version was bumped that would step be the same file that would generate your report. There isn't anything that I'm going to be doing here to the reporter, I'm closing this issue. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is There An Existing Issue
What Are You Seeing
When attaching reports to my Jenkins build, ...
(cannot insert screenshot)
... and clicking one of the HTML file links on the left, e.g. "test-result-IT.html", the report is displayed like this:
(cannot insert screenshot)
Using developer tools in the browser, I see that it reports "blocked (csp)" for 4 different CSS stylesheets:
(cannot insert screenshot)
If I donwload the same HTML file and open it in the browser from my local drive, it works normally.
Steps To Reproduce The Issue
Run Newman from Jenkins
Full Newman Command Or Node Script
HTMLEXTRA Version
latest
Newman Version
6.0.0
Additional Context
x
The text was updated successfully, but these errors were encountered: