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
how to attach base64 image to extent report, when testing failed? #11
Comments
Have u checked the sample implementation - https://github.com/grasshopper7/cuke6-extent-adapter-report/blob/2f366dffea4c1d2f607c19eb703f6a842ceb3519/cuke6-extent-adapter-report/src/test/java/stepdefs/Stepdefs.java#L96 |
hi @grasshopper7 |
Had tried it some time back, but the browser was not displaying them. What is the reason for using this approach? |
Because it is more convenient for our company to present the report in this way(by the way, cucumber native report is also used base64 images to show its screenshots), But a relatively bad method was used to solve it, that is, after the report is generated, the .png file is converted to a base64 string and replaced../embedded1.png |
U can try it pretty easily. There is createScreenCaptureFromBase64String in MediaEntityBuilder class. https://github.com/extent-framework/extentreports-java/blob/b3e079b1d351bffcb8d82972372dc9635ed31a2b/src/main/java/com/aventstack/extentreports/MediaEntityBuilder.java#L43 In the ExtentCucumberAdapter change the implementation of the handleEmbed Line 214 in 28eba5e
Most of the existing code can be removed other than the mimetype check. Just add below. Should work.
Let me know if it works. I will include an option to use base64 for attachments in future release. |
Cool. I will look into adding the base64 option images to html. Which report are u trying to generate when using the cucumber6 adapter? Only Spark and Json are available in extent 5. |
ok, I see. perhaps I should continue use the cucumber extent 4.^_^ thanks a lot. |
what cucumber version are u using? u should be using adapter corresponding to that. |
I have added base64 support for images. - https://oss.sonatype.org/content/repositories/snapshots/tech/grasshopper/extentreports-cucumber6-adapter/ U will need to add below dependency to project POM
Set the below property in extent.properties U will need to enable snapshot release in POM - https://stackoverflow.com/questions/16286055/how-to-get-snapshot-from-sonatype/16286460#16286460 Let me send your feedback, then I will proceed to release this as a full upgrade. My concern is that the spark report size is going to be an issue |
@grasshopper7 thank your effort to support this, very thanks!! |
Will close after full maven release. |
Added in 2.6.0 |
No description provided.
The text was updated successfully, but these errors were encountered: