dutchiexl / BehatHtmlFormatterPlugin

This is a behat plugin to generate HTML reports
MIT License
112 stars 117 forks source link

Report not rendering multiline pystring json object #109

Open nodeJerry opened 5 years ago

nodeJerry commented 5 years ago

My report will not render/ display the multiline json object. when i inspect the html in the browser. I can see the json data. But it is just not rendered.

nodeJerry commented 5 years ago

Can any one give some insight to this ?

for example

the "i send post request ....... with body:

will not output in the report.

image

PurHur commented 5 years ago

Can you provide a screenshot of the generated html so we do not have to setup your test?

nodeJerry commented 5 years ago

Thank you for coming back to me PurHur. While examining this a little more. I believe i am not actually seeing a lot of data.

I have taken the html from webpage behind firewall in our staging environment. and pasted it in to brackets, and then presented it to a browser.

Some UI objects are being presented which i can not see behind firewall.

nodeJerry commented 5 years ago

image

nodeJerry commented 5 years ago

So the items with the arrows are not being presented behind firewall

nodeJerry commented 5 years ago

getting only one error behind firewall

image

nodeJerry commented 5 years ago

the read me on https://packagist.org/packages/emuse/behat-html-formatter does not show the ui elements pointed to by the arrows

nodeJerry commented 5 years ago

Why is my scenario-overview hidden

PurHur commented 5 years ago

You showed two diffrent reports. The first one (without the arrows) is the old behat2 report style. You can use that with --format behat2

The second one is the twig template which requires jquery and bootstrap to load from external servers.

I guess the error is happening because your firewall blocked: https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js (and the other resources)

I will merge #114 soon so you can change the template for your needs.

nodeJerry commented 5 years ago

Thanks again for your help PurHur.

As you can see this is REST API tesging.

Two years ago i made a fork and i created https://github.com/ijerry/BehatHtmlFormatterPlugin for the report to work behind firewall. So behind the firewall i can access these resources with this change.

So I am working off Twig version of the report. Not older version

So how can i get the new version of the report display the "Scenario-overview" part of the report ?

Also in the below diagram around the "STAR" graphic; How can i get the report to display the information here " a JSON PAYLOAD"

nodeJerry commented 5 years ago

image

zanderFortinbras commented 2 months ago

@PurHur I am having this problem

zanderFortinbras commented 2 months ago

image

zanderFortinbras commented 2 months ago

I am trying to print out the pystring directly because $body_string = $string->getRaw(); $json_string = json_encode($body_string, JSON_PRETTY_PRINT); echo($json_string);

PurHur commented 2 months ago

@zanderFortinbras This is expected because the default templates for the test results are quite old and non responsive.

You can define your own template or change the old one to something more elaborate. If you done that feel free to make a PR i will include all templates of the community in this repo if you want to share.