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

Allow to add information from code #30

Open
j320 opened this issue Jul 4, 2023 · 8 comments
Open

Allow to add information from code #30

j320 opened this issue Jul 4, 2023 · 8 comments

Comments

@j320
Copy link

j320 commented Jul 4, 2023

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
Copy link
Owner

What kind of information are you planning to add?

@j320
Copy link
Author

j320 commented Jul 4, 2023

Information that may change dynamically such as:

  • Environment
  • Version
  • Browser
  • OS
  • Report title depending on the above

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
Copy link
Owner

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
Copy link
Author

j320 commented Jul 5, 2023

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
Copy link

@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
Copy link
Owner

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

@ramesh-khatri
Copy link

@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
Copy link
Owner

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

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

No branches or pull requests

3 participants