Skip to content
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 can I add SystemInfo to reports? #51

Open
vzenzo opened this issue Apr 11, 2020 · 19 comments
Open

How can I add SystemInfo to reports? #51

vzenzo opened this issue Apr 11, 2020 · 19 comments
Labels
question Further information is requested

Comments

@vzenzo
Copy link

vzenzo commented Apr 11, 2020

When using extent reports I would just add extent.setSystemInfo("InfoField", "InfoString")

Can I do this in html-config.xml or sparl-config.xml?
I really need this as adapter simplified my code but the report is full of issues now
(reporting hook tags such as @afterstep, wrong colors in diagrams like skipped test is blue but check is yellow)

@anshooarora
Copy link
Member

@vzenzo

The @AfterStep issue is currently in progress, use version 1.0.12-SNAPSHOT.

I will mark the color issue in the API. Ref: extent-framework/extentreports-java#144

@anshooarora
Copy link
Member

Regarding system info, this is currently not possible through configuration files. However, you can use:

ExtentService.getInstance().setSystemInfo(k, v);

@anshooarora anshooarora added the question Further information is requested label Apr 13, 2020
@vzenzo
Copy link
Author

vzenzo commented Apr 14, 2020

Regarding system info, this is currently not possible through configuration files. However, you can use:

ExtentService.getInstance().setSystemInfo(k, v);

is there any special place to put this? in some class or annotation?

@zuzeac
Copy link

zuzeac commented Apr 14, 2020

I've add this into the Runner class with @afterclass and work as expected

@AfterClass public void setReportInfo() { ExtentService.getInstance()..setSystemInfo("App", APP_VERSION); ExtentService.getInstance().setSystemInfo("Device", BaseSetup.deviceName + " with " + BaseSetup.platformVersion); }

@vzenzo
Copy link
Author

vzenzo commented Apr 14, 2020

I've add this into the Runner class with @afterclass and work as expected

@AfterClass public void setReportInfo() { ExtentService.getInstance()..setSystemInfo("App", APP_VERSION); ExtentService.getInstance().setSystemInfo("Device", BaseSetup.deviceName + " with " + BaseSetup.platformVersion); }

Thank you very much!

@anshooarora
Copy link
Member

@vzenzo The SKIPPED color has been corrected in all charts.

You have opened a new issue: https://github.com/extent-framework/extentreports-cucumber5-adapter/issues/1. Is this the same issue for cucumber4-adapter?

@vzenzo
Copy link
Author

vzenzo commented Apr 20, 2020

@vzenzo The SKIPPED color has been corrected in all charts.

You have opened a new issue: extent-framework/extentreports-cucumber5-adapter#1. Is this the same issue for cucumber4-adapter?

The skip steps are with orange color but on circle they are blue

cucumber4 adapter does not show hooks anymore, since 1.0.11

Edit: I have tried now with 1.0.12 and it shows some hooks

image

@vzenzo
Copy link
Author

vzenzo commented Apr 20, 2020

Back to this issue, when I put @afterclass it does nothing, I have also tried with @AfterTest and @AftersSuite, none of them add SystemInfo, only way it works is if I put it into @after tear down method but then it repeats same info each scenario

image

@anshooarora
Copy link
Member

@vzenzo

I do not see any blue circles in the screenshot.

You can use this workaround to ensure the code inside this block executes only once: cucumber/cucumber-jvm#515 (comment)

@vzenzo
Copy link
Author

vzenzo commented Apr 21, 2020

@vzenzo

I do not see any blue circles in the screenshot.

Sorry didn't place screenshot for that

image

You can use this workaround to ensure the code inside this block executes only once: cucumber/cucumber-jvm#515 (comment)

What is the workaround here? There is so many things here I don't know where to start

@vzenzo
Copy link
Author

vzenzo commented Apr 21, 2020

I've fixed the SystemInfo issue by putting it into @afterclass in a test runner

@grasshopper7
Copy link

@anshooarora @vzenzo I had modified the code to take in system info details from the extent-config.xml.
<systeminfo.os>Windows</systeminfo.os> <systeminfo.version>10</systeminfo.version>
This ideally should be from the extent.properties. If you think this solution seems suitable I can create a pull request.

@vzenzo
Copy link
Author

vzenzo commented Apr 27, 2020

@anshooarora @vzenzo I had modified the code to take in system info details from the extent-config.xml.
<systeminfo.os>Windows</systeminfo.os> <systeminfo.version>10</systeminfo.version>
This ideally should be from the extent.properties. If you think this solution seems suitable I can create a pull request.

this would be great!

@zuzeac
Copy link

zuzeac commented Apr 27, 2020

@grasshopper7 but it will also remain the possibility to add it from ExtentService instance? Because I'm adding dynamic data in system info and by adding it from config file only I don't see how can it be done.

@grasshopper7
Copy link

@zuzeac It should not interfere with adding of system info from code. Though I will test it out to make sure.

@VishalKTechnocredits
Copy link

VishalKTechnocredits commented May 3, 2020

@vzenzo @anshooarora How did you resolve this issue. I am facing the same issue. System info are appearing if I put them into @after hook and its repeating after every scenario. but it is not showing in report when I am putting them into @afterclass

@zuzeac
Copy link

zuzeac commented May 3, 2020

@VishalKTechnocredits make sure @afterclass is in the runner class.

@grasshopper7
Copy link

grasshopper7 commented May 12, 2020

I created a PR which allows the system info to be picked up from extent.properties and also when passed in the maven command. #57

@anshooarora
Copy link
Member

@grasshopper7 Thanks, I will check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants