grasshopper7 / extentreports-cucumberjson-plugin

This deals with generating Extent reports for Cucumber-JVM version 4.3 and above by using a Maven Plugin which parses the Cucumber JSON report.
https://ghchirp.online/2114/
MIT License
2 stars 0 forks source link

Mime type text/html not supported in extent pdf report #22

Closed bothikarsk closed 2 years ago

bothikarsk commented 3 years ago

Getting warning mime type text/html not supported for scenario.attach(byte [] data, "text/html", "name" ) . Html is not added to step definition in extent pdf report. I am using io.cucumber 6.9.1 version.

grasshopper7 commented 3 years ago

try using scenario.log().

bothikarsk commented 3 years ago

Well scenario.log() is just adding the html as plain text . Html interpretation is not happening.

bothikarsk commented 3 years ago

I am expecting it to be added as table. For e.g in cucumber masterthought report html table is added for same step. If possible please check if this can be done in pdf report IMG20210921180312

bothikarsk commented 3 years ago

In pdf report just plain text is added IMG20210921175834__01

grasshopper7 commented 3 years ago

Got it now. Interesting. Will try for next release.

bothikarsk commented 3 years ago

Thank you

bothikarsk commented 3 years ago

@grasshopper7 Hope all is well with you. Please let me know whenever mime type text/html is supported by pdf report.

Thanks, Santosh.

grasshopper7 commented 3 years ago

Have not looked at in great detail, but it seems to be a big task. There is a artifact available which does the conversion of html to pdf snippets but the main issue is the space constraint of the PDF page. Will have a detailed look, by the end of this week. Then will be able to make a decision. Thx.

bothikarsk commented 3 years ago

Thank you. Please do let me know what you decide.

grasshopper7 commented 3 years ago

Hi... Unfortunately the artifact I thought would do the job will not work, as overflow and splitting needs to be handled.

Will have to use jsoup to parse the html table contents and create a pdf table manually. This will be cropped lengthwise to fit the page. A similar display if you use a large datatable. Also the number of rows maybe an issue. The html display will only work for tables.

Will give it a try, if it works then should take around 7-10 days.

bothikarsk commented 3 years ago

Thank you for looking into this. Hope that will work. Appreciate your help.

Thanks, Santosh.

bothikarsk commented 3 years ago

Hi, Any luck with the approach you wanted to give it try?

Thnx

grasshopper7 commented 3 years ago

Have been kind off busy. Do u need this for your professional work? If so will attempt it this weekend.

bothikarsk commented 3 years ago

Yes need this for my professional work. I am using this plug in to generate pdf and sending same to team in email. Team is looking for additional details and verification in report which are configured with mimetype text/html.

I would appreciate if you could take a look at it..

Thanks, Santosh.

grasshopper7 commented 3 years ago

An initial implementation is available in repository (2.9.0). It will only support simple table html, no spans or any other stuff. The html snippet has to begin with "<table". I have to put in checks and add a default text display in case of trouble.

U can try it by building the code. U will need a 3 jars. Just follow the POM dependencies trail.

Should be available in Maven in a couple of days if all goes well.

grasshopper7 commented 3 years ago

Version 2.9.0 has been uploaded. Should be replicated to Maven soon.

bothikarsk commented 3 years ago

Thank you. I will update to latest version and let you know.

bothikarsk commented 2 years ago

Hello, Thank you for all the effort and time you spent on this thread.

Hope all is well with you. Apologies. I was off the work all these while so could not check and respond.

I have tried with maven version 2.9.1 but still observing same behaviour.(Warning with message mime type text/html not supported).

Would you be able to check and advise ?

Thank you again !.

Thanks, Santosh.