grasshopper7 / extentreports-cucumber7-adapter

Cucumber-JVM 7 Adapter for Extent Framework
https://ghchirp.online/3196/
MIT License
17 stars 8 forks source link

Allow to add information from code #30

Open j320 opened 1 year ago

j320 commented 1 year ago

From what I can see, the report can only be configured by hardcoding the information into the .properties and .xml files. I wanted to know if there's a way to add information via the Java code as that'd allow for dynamic property setting.

grasshopper7 commented 1 year ago

What kind of information are you planning to add?

j320 commented 1 year ago

Information that may change dynamically such as:

and such that can be easily put into conditions and add correctly using parameters in the code or the CI if there'd be something like what ExtentReports has with 'setSystemInfo'.

grasshopper7 commented 1 year ago

You can currently use ExtentService.getInstance().setSystemInfo() in your code. Will look at some other way in a later release. Dynamic title modification is not possible as it is picked up directly from the configuration file in the extent core code. Additional code will be required in the adapter to overwrite the title

j320 commented 1 year ago

Thank you for that, it helps for some bits. It'd be great to be able to overwrite the report name and the document title as well so if that could be implemented it'd make the library even more complete.

Anyhow, thank you for quickly responding to my issue and let you know that your library is great. I look forward to upcoming updates.

ramesh-khatri commented 1 year ago

@grasshopper7 Suppose extent.properties has "extent.reporter.spark.out=output/Report.html". Can I set it dynamically from my code, as I have two runner class and I need report in two different location. Does extentreports-cucumber7-adapter support this?

grasshopper7 commented 1 year ago

Dynamic properties are not supported. Two runners in same execution will use the same values. You will need to run them separately

ramesh-khatri commented 1 year ago

@grasshopper7 Thank you! ..Suppose I have two runner A.java and B.java...Can A.java read from extent.properties and B.java can read from extentNew.properties. I will first run A.java and once it is completed, I will run B.java. If possible, any reference will be helpful. Thank you!.

grasshopper7 commented 1 year ago

It will not work, this is fixed in the core ExtentReport code over which I do not have any control.