DannyDainton / newman-reporter-htmlextra

A HTML reporter for Postman's Command Line Runner, Newman. Includes Non Aggregated Runs broken down by Iterations, Skipped Tests, Console Logs and the handlebars helpers module for better custom templates.
Apache License 2.0
356 stars 139 forks source link

Jenkins html report not displaying nicely #45

Closed petrheckoHims closed 5 years ago

petrheckoHims commented 5 years ago

Hello,

Firstly, thanks a lot for this amazing html reporter, it looks great! I was wondering if there is any way to make it work with jenkins html publisher (or if I'm doing something wrong on my end?). If I run newman locally with the exact same parameters, I get a nice report as expected. If I run the same in Jenkins via this command:

newman run "https://api.getpostman.com/collections/${uid}?apikey=${postman_api}" \
--reporters cli,junit,htmlextra \
--reporter-junit-export "newman/report.xml" \
--reporter-htmlextra-export "newman/report.html"

It will generate the report.html file just fine. The problem is that when using the jenkins plugin, HTML Publisher, the report is displayed all over the place, making it not really readable. I also have an email notification set which will email me the report.html file, however, it's the same issue when clicking on the report from the email will not display it properly, but I need to actually download the report from the email first and then open it - this way the report will display correctly, but it's more steps to achieve it.

Any advice will be appreciated.

DannyDainton commented 5 years ago

Hey,

Thanks for the feedback.

I don't really know anything about that plugin or know what it's doing in Jenkins.

If the information is there but the styling isn't, it could be blocking some of the CSS/JS references in the file. Have you checked the Dev Tools for any errors.

Sorry, I really have no idea what's going on with that as it's not an area that I have experience of.

petrheckoHims commented 5 years ago

Thanks Danny, I will try to troubleshoot some more - seems like it has to do with Content Security Policy as when disabled in Jenkins, the report will display (but that's not safe), so I will keep troubleshooting.

DannyDainton commented 5 years ago

OK, I'm going to close this for now. We can reopen if you find a reporter specific issue.

Interesting to know the outcome of your investigation though.

bmakamsatyaprakash commented 5 years ago

This is how the report is looking like on Jenkins pipeline

Screen Shot 2019-06-20 at 3 54 52 pm
bmakamsatyaprakash commented 5 years ago

and looking for that to look like this

Screen Shot 2019-06-20 at 3 56 11 pm
DannyDainton commented 5 years ago

That's doesn't really have anything to do with the reporter - It's a Jenkins confirmation thing that I have zero control over.

This was a solution that worked for someone else over in the Postman community.

https://community.getpostman.com/t/newman-htmlextra-reporter-not-displaying-correctly-when-viewed-from-jenkins/5735/2

petrheckoHims commented 5 years ago

I'm able to see the nice version of the newman report after changing the jenkins CSP to:

sandbox allow-same-origin allow-scripts; default-src 'self'; script-src 'unsafe-eval' *; img-src *; style-src 'unsafe-inline' *; font-src *;

You can refer to this article for more details of how to make the CSP change.

bmakamsatyaprakash commented 5 years ago

Hi ,

Really appreciate your help.. It worked :) !!!

Thank You very much for helping me and making it would in no time. This was very crucial for me and you helped me to get the issue resolved . Running this on terminal as per your details worked perfectly fine giving me nice reports.

java -Dhudson.model.DirectoryBrowserSupport.CSP="sandbox allow-same-origin allow-scripts; default-src 'self'; script-src 'unsafe-eval' ; img-src ; style-src 'unsafe-inline' ; font-src ;" -jar jenkins.war --httpPort=8082

Regards, Bindhu Makam Senior Consultant | Platform Engineering Deloitte Consulting Pty Ltd 225 George Street, Sydney, NSW, 2000, Australia Tel : Mobile: +61 403146677 bmakamsatyparakash@deloitte.com.aumailto:bmakamsatyparakash@deloitte.com.au | www.deloitte.com.auhttp://www2.deloitte.com/au/en.html?utm_source=outlook&utm_medium=email&utm_campaign=exc-outlook-signature&utm_content=text

From: petrheckoHims notifications@github.com Reply-To: DannyDainton/newman-reporter-htmlextra reply@reply.github.com Date: Friday, 21 June 2019 at 10:42 am To: DannyDainton/newman-reporter-htmlextra newman-reporter-htmlextra@noreply.github.com Cc: "Makam Satyaprakash, Bindhu" bmakamsatyaprakash@deloitte.com.au, Comment comment@noreply.github.com Subject: [EXT]Re: [DannyDainton/newman-reporter-htmlextra] Jenkins html report not displaying nicely (#45)

sandbox allow-same-origin allow-scripts; default-src 'self'; script-src 'unsafe-eval' ; img-src ; style-src 'unsafe-inline' ; font-src ; This e-mail and any attachments to it are confidential. You must not use, disclose or act on the e-mail if you are not the intended recipient. If you have received this e-mail in error, please let us know by contacting the sender and deleting the original e-mail. Liability limited by a scheme approved under Professional Standards Legislation. Deloitte refers to a Deloitte member firm, one of its related entities, or Deloitte Touche Tohmatsu Limited (“DTTL”). Each Deloitte member firm is a separate legal entity and a member of DTTL. DTTL does not provide services to clients. Please see www.deloitte.com/about to learn more. Nothing in this e-mail, nor any related attachments or communications or services, have any capacity to bind any other entity under the ‘Deloitte’ network of member firms (including those operating in Australia).

jimmymccauleybp commented 5 years ago

Hi @bmakamsatyaprakash @petrheckoHims Same issue has been causing me a few problems too! I have been wasting my time looking at NPM dependencies which is not the correct solution. I'm glad it's been resolved for you. Could I please ask where exactly you run this command? I am assuming you will need a Jenkins administrator to execute this command, if you don't have admin? Appreciate you confirmation; Thanks!

bmakamsatyaprakash commented 5 years ago

Hi ,

I ran below command on terminal (mac) when starting up my jenkins. Jenkins is on my local machine for now. After running below command, I got nice reports. Please try and let me know.

“java -Dhudson.model.DirectoryBrowserSupport.CSP="sandbox allow-same-origin allow-scripts; default-src 'self'; script-src 'unsafe-eval' ; img-src ; style-src 'unsafe-inline' ; font-src ;" -jar jenkins.war --httpPort=8082”

Regards, Bindhu Makam Senior Consultant | Platform Engineering Deloitte Consulting Pty Ltd 225 George Street, Sydney, NSW, 2000, Australia Tel : Mobile: +61 403146677 bmakamsatyparakash@deloitte.com.aumailto:bmakamsatyparakash@deloitte.com.au | www.deloitte.com.auhttp://www2.deloitte.com/au/en.html?utm_source=outlook&utm_medium=email&utm_campaign=exc-outlook-signature&utm_content=text

From: jimmymccauleybp notifications@github.com Reply-To: DannyDainton/newman-reporter-htmlextra reply@reply.github.com Date: Tuesday, 2 July 2019 at 8:56 am To: DannyDainton/newman-reporter-htmlextra newman-reporter-htmlextra@noreply.github.com Cc: "Makam Satyaprakash, Bindhu" bmakamsatyaprakash@deloitte.com.au, Mention mention@noreply.github.com Subject: [EXT]Re: [DannyDainton/newman-reporter-htmlextra] Jenkins html report not displaying nicely (#45)

Hi @bmakamsatyaprakashhttps://secure-web.cisco.com/1NQTAbBE3HTJHuH0sCcRaiuu0bwnXxSlqIayzYCWC-WIVcsiMTXOseK9huWmIeLFJRj4IggAdAUwmdA_JKuJ_iae5n2YqSP5lsnjRbXteCim9C5F5y0P7nt7a7tIYzg2bulxMld5GFKustTDeO06u9biZEbGoIisDW37Y78CjnNesCEzxEcZbWkXXU04vBARMt56oWQqIp_22Zt1lGjF5WBr38AR88a1Oe7pqisSQu239fpZzKa6JWrjvzEByyzB5ot09BWLbFzRxY0j3cJ59AlfDLSPxsPIAlzjQR6QqbG0Nh7Z3Cfjxh91sFUWJn-q8VC6dPp50X_Na0Hdgfx1Qlg/https%3A%2F%2Fgithub.com%2Fbmakamsatyaprakash @petrheckoHimshttps://secure-web.cisco.com/1-sfk4I_c7-5siZIO7gTBjIedRxw2zkJ-YRoXazHj6DBOpCh9zDwuI-sG2w0WbXwDHR5MjTItbdChMRrc7mbdZvd1vzdDX6YC03ojVf3j9kwEbcRKGSU9U5_KGjgOqGtMjZsdXoIcTTTAVpagBLTrDu0OSWn58xKmeaWe0KyWNehHE7dWxGSRSg-LCjsJJ5A8ukBTfiwQdUGf0ShN6YiRYLRAv6En2KQ9F9b0qQ-_Cw6zBC-UJDiwYCtLQtLi6qRJ4vZXDjzWLgU2bmaTnOEVjmc9dDFudz-89MmhgJYlwnfdW0rPcirtik2_4_GHt5wLtb9WILifUI69Z3XAbzL84g/https%3A%2F%2Fgithub.com%2FpetrheckoHims Same issue has been causing me a few problems too! I have been wasting my time looking at NPM dependencies which is not the correct solution. I'm glad it's been resolved for you. Could I please ask where exactly you run this command? I am assuming you will need a Jenkins administrator to execute this command, if you don't have admin? Appreciate you confirmation; Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1qejpYvl_4HcOmeiPDp5rj0zXGLEMiiyqKCqQkt9x3fO9shfXtE3m6qdWqNNX2ldqgg08r0ZsRQKdEq2B5PxwFjJnlTj-xv4kz2VJqyRQwGsX_qZxV82Y99E73FZkirUAko3Jcf5lFUeH6Wfb2doET3BEWGgybXSDcanfpBGUdte8ErwIY3O63DA1pO-fzyZtCwZbE01UbgosA3w97UoPvWRVVT5fRxRma52_aIFLM7rRdDYQNqioXCESRp0tLfLkJQ26ceL1OJYeN7FnUW8HkxspowAaXhT3WhKbIzU6HANuWhWYb7jyTxub3GrRAyIQyMzEA3euB39oCNnkoco2eg/https%3A%2F%2Fgithub.com%2FDannyDainton%2Fnewman-reporter-htmlextra%2Fissues%2F45%3Femail_source%3Dnotifications%26email_token%3DAIT7YH3BOIU32G7DG3GPKATP5KDQZA5CNFSM4HLFNEA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY7SGWA%23issuecomment-507454296, or mute the threadhttps://secure-web.cisco.com/1MPqNLWaliCX5Ga5fO_wYGa_zotRbigmLKg5z0lT8hwSQeOTdexzuoL6yg0Bua6AxivjZSucIX7pC75Gx1PytyxWF_Klv9mCQKoAGGwik4-s_SULKZjiCGcOtD8BH7CdOkgIrpjUSBv8uW7knJGV3M2AdjoPQgY7rWs30cvasze3rsgpWMUFy_JGWpvqRUBHiGu1pI-WQY25cJGjr06gJkH0K-WmtWVkDgbMEE5N63RptQwG8I-MQ6wmge-nHXEBh9xama_v9vRnSLzkNYNPd2895Fxay_YgFs9WEUcBBqBuQWzDao0LuY-IWRBev4dnLpOsXzGMb0olJGZrMPA1wsQ/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAIT7YH44B3VDQRGWQSBSZVTP5KDQZANCNFSM4HLFNEAQ.

This e-mail and any attachments to it are confidential. You must not use, disclose or act on the e-mail if you are not the intended recipient. If you have received this e-mail in error, please let us know by contacting the sender and deleting the original e-mail. Liability limited by a scheme approved under Professional Standards Legislation. Deloitte refers to a Deloitte member firm, one of its related entities, or Deloitte Touche Tohmatsu Limited (“DTTL”). Each Deloitte member firm is a separate legal entity and a member of DTTL. DTTL does not provide services to clients. Please see www.deloitte.com/about to learn more. Nothing in this e-mail, nor any related attachments or communications or services, have any capacity to bind any other entity under the ‘Deloitte’ network of member firms (including those operating in Australia).

jimmymccauleybp commented 5 years ago

Hi @bmakamsatyaprakash Thanks for replying so quickly. I've passed the info onto the Jenkins admin who executed the command. It's all working nicely now. All the best!

DannyDainton commented 5 years ago

Good to see you got it sorted!

Please feel free to open new issues, if you find something specifically wrong with the report itself.

jimmymccauleybp commented 5 years ago

Cheers Danny - and kudos! the enhanced report is awesome....

bmakamsatyaprakash commented 5 years ago

That’s wonderful! Thanks for letting me know.

Regards, Bindhu Makam Senior Consultant | Platform Engineering Deloitte Consulting Pty Ltd 225 George Street, Sydney, NSW, 2000, Australia Tel : Mobile: +61 403146677 bmakamsatyparakash@deloitte.com.aumailto:bmakamsatyparakash@deloitte.com.au | www.deloitte.com.auhttp://www2.deloitte.com/au/en.html?utm_source=outlook&utm_medium=email&utm_campaign=exc-outlook-signature&utm_content=text

From: jimmymccauleybp notifications@github.com Reply-To: DannyDainton/newman-reporter-htmlextra reply@reply.github.com Date: Tuesday, 2 July 2019 at 6:05 pm To: DannyDainton/newman-reporter-htmlextra newman-reporter-htmlextra@noreply.github.com Cc: "Makam Satyaprakash, Bindhu" bmakamsatyaprakash@deloitte.com.au, Mention mention@noreply.github.com Subject: [EXT]Re: [DannyDainton/newman-reporter-htmlextra] Jenkins html report not displaying nicely (#45)

Hi @bmakamsatyaprakashhttps://secure-web.cisco.com/1KUb2szp_sH3bOvUxjNRhzdmsWPeahB60nrchY5AnIcPbcREIjqvC8vfpj5vfVgU4N97KxLcnstamGYtJIYOlVKtmUZ9RbwgHY0YnWd6hME0vXxdhusl53UWcuiE1C3DSUoMgdhrq3cJe9UxRxsqm6mAnrSj0xK9LcHlevDcGJZ93hy1zlEijC_7lYtXGMpK0sJ8u-St4Be1LgXGJQsINCVFFy49d25nT_reaTp_fJ5_JuXLg3Jx-1LIpvulGJc2AvclmWvqWGDG-4TsFh6qnJ-NJZv9NIxs15pREfP1WFAjROv_rCHMDEUbNCLJbkMeIxdDUnMNYyvNB2nEWRQbLxg/https%3A%2F%2Fgithub.com%2Fbmakamsatyaprakash Thanks for replying so quickly. I've passed the info onto the Jenkins admin who executed the command. It's all working nicely now. All the best!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1kcfJzXFbh98CKctyJBFmFm-Xrpr4FA8eOtpuLvZSVQhsHxGe6fgLp_CCc6gjm-ywkVO8d0nM1VCR19cqY_LDK2pfoRtM49EyhSKq2kJRNGagZ6N_6bewvJ5g1wjBMDJC5moG28CYz5WR09MSQyrvmTBJLOwhqGqFIYA5IAtaayVPEk5mBCtIzl4_wJo0FAJgF1KJbqb6gXyAbEzIYXfkA8HQbuyzKi6kDpy0fMtvXwcI2GSaX0X-f-G5QmBuByhccvngyRip4q5SG-XULDC-Xh-rjQWaQR-HiZFE8niy8hUq-uQI3vPUvVNOgl0mAFmFMWlfDjBi_sNRai0dCfkK_A/https%3A%2F%2Fgithub.com%2FDannyDainton%2Fnewman-reporter-htmlextra%2Fissues%2F45%3Femail_source%3Dnotifications%26email_token%3DAIT7YH5UTEIUBMSCTXXIFT3P5MDXXA5CNFSM4HLFNEA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZAN5BI%23issuecomment-507567749, or mute the threadhttps://secure-web.cisco.com/1vM_9Nj3uXsYr8lr7Eo2c-d5AoialZkbuHLUt5Fki9TRiG701DcfGt-vFbLtZfqwqfcGLZk62pu0SfCueikESPn0nXOFLSZ5dMafVWtIPX6HLy3-ZsxtNQc7WhqGnVnJpnALNm-PY2rBflY8P5ORrCspYmeUSDSAAhu1MET4HuPvPsbzT5ZGmOp_VjY07UKeksr5R6mFPyTwT4VqgVqXa4Nr1SQ7fTpTUIXNqq95cUCP4EUEfxRXnQmafORLlheaDCKQ9xJKd4k8YsoMrMn62JbNqFY2yOuCC3WpvvFkAFAgfLUJ-Hu4Yt3AUksYI-Hta2w5w16q1GsjC1SGGCklWpA/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAIT7YH4XP7LBWNOT43OQJL3P5MDXXANCNFSM4HLFNEAQ.

This e-mail and any attachments to it are confidential. You must not use, disclose or act on the e-mail if you are not the intended recipient. If you have received this e-mail in error, please let us know by contacting the sender and deleting the original e-mail. Liability limited by a scheme approved under Professional Standards Legislation. Deloitte refers to a Deloitte member firm, one of its related entities, or Deloitte Touche Tohmatsu Limited (“DTTL”). Each Deloitte member firm is a separate legal entity and a member of DTTL. DTTL does not provide services to clients. Please see www.deloitte.com/about to learn more. Nothing in this e-mail, nor any related attachments or communications or services, have any capacity to bind any other entity under the ‘Deloitte’ network of member firms (including those operating in Australia).

bmakamsatyaprakash commented 5 years ago

Yes.. Someone from your team replied and helped me to get this resolved and helped a lot in my demo. Cheers! Sure, thanks for all the support.

Regards, Bindhu Makam Senior Consultant | Platform Engineering Deloitte Consulting Pty Ltd 225 George Street, Sydney, NSW, 2000, Australia Tel : Mobile: +61 403146677 bmakamsatyparakash@deloitte.com.aumailto:bmakamsatyparakash@deloitte.com.au | www.deloitte.com.auhttp://www2.deloitte.com/au/en.html?utm_source=outlook&utm_medium=email&utm_campaign=exc-outlook-signature&utm_content=text

From: Danny Dainton notifications@github.com Reply-To: DannyDainton/newman-reporter-htmlextra reply@reply.github.com Date: Tuesday, 2 July 2019 at 6:06 pm To: DannyDainton/newman-reporter-htmlextra newman-reporter-htmlextra@noreply.github.com Cc: "Makam Satyaprakash, Bindhu" bmakamsatyaprakash@deloitte.com.au, Mention mention@noreply.github.com Subject: [EXT]Re: [DannyDainton/newman-reporter-htmlextra] Jenkins html report not displaying nicely (#45)

Good to see you got it sorted!

Please feel free to open new issues, if you find something specifically wrong with the report itself.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1ojaG3rc39JnOMARnw3hAAWljC4d7ZkZZYXszGBIyTtah-ccSbZVSSofHMPOCLjyK3IcX7T2UYljvU1c72lJ3GtBqubAViGXlivex5os_vWTzxmh-u8zKzt4aS-QNbSlygWwZvA1YerWEa4a_ukHyBbu1T3FgWrldGv3OepPcF9iQLuFcNvgVUZ7tar8LYtdF1nt6QcRJeUd-9D-h65CfQWYVlxaUFshQXCo2hF__gk2wvdHrUVbD1Kv0uG0738HzeuD6XLQm3KYGAzLFsc1BvN519jxnizel4i4is_fBWt_kSpWkpgW1GcjuQI2ULQNVIDkcLfTgaxCT3Fy6DZyyiQ/https%3A%2F%2Fgithub.com%2FDannyDainton%2Fnewman-reporter-htmlextra%2Fissues%2F45%3Femail_source%3Dnotifications%26email_token%3DAIT7YH65TWFI4DRNLKWJFU3P5MD57A5CNFSM4HLFNEA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZAOBFI%23issuecomment-507568277, or mute the threadhttps://secure-web.cisco.com/1yhTZ8LEJCJ8qBTQA4uGCbd7C67pst4grdK5LPrfKWnaHJnJYnP8UP9AXH-2ep2sfaMY3ArG6LZYIfd8TT8A0iw33aMrv2V-61Ab8aPdXXZCYyfEFxXFGo3cxZ1BhaRVVIEde1Q8y43cpISSHr-sNFwh-R3XSBIwxQRwWWgl2I05RbAtMnwtaVSbUFAG9aUQ-Ngz5J4l0bHBKCv7cAPUbmx3OMpevkfycOrXZPR6DYdCfohJoEyzg7BMdeNdY7xqR07wRAU-dIfdxWqIO0nLLZ2qLP7cGjJcFjHqhfCjXlxcn2V6fL5nNp-HVaeNMwMAlSi93YufYoe7OngP6pZecOw/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAIT7YH536CSIWYMVTM2ZDQLP5MD57ANCNFSM4HLFNEAQ.

This e-mail and any attachments to it are confidential. You must not use, disclose or act on the e-mail if you are not the intended recipient. If you have received this e-mail in error, please let us know by contacting the sender and deleting the original e-mail. Liability limited by a scheme approved under Professional Standards Legislation. Deloitte refers to a Deloitte member firm, one of its related entities, or Deloitte Touche Tohmatsu Limited (“DTTL”). Each Deloitte member firm is a separate legal entity and a member of DTTL. DTTL does not provide services to clients. Please see www.deloitte.com/about to learn more. Nothing in this e-mail, nor any related attachments or communications or services, have any capacity to bind any other entity under the ‘Deloitte’ network of member firms (including those operating in Australia).

Dohbedoh commented 3 years ago

A better solution than using the CSP header / relaxing CSP rules in Jenkins is to setup a Resources Root URL, available since Jenkins 2.200: https://www.jenkins.io/doc/upgrade-guide/2.204/#resource-domain-support

github-actions[bot] commented 2 years ago

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.