galen
galen copied to clipboard
Improve Galen config handling
- Would be helpful to create a enum with all possible config parameter:
public enum ConfigParameter {
//@formatter:off
LOG_LEVEL("galen.log.level",10,"Used log level","Used log level"),
SCREENSHOT_AUTORESIZE ("galen.screenshot.autoresize",true,"Should screenshots get resized","Should screenshots get resized"),
SCREENSHOT_FULLPAGE("galen.browser.screenshots.fullPage",false,"Take fullscreen screenshots","Take fullscreen screenshots"),
SCREENSHOT_FULLPAGE_SCROLLWAIT("galen.browser.screenshots.fullPage.scrollWait",0,"Timeout for fullscreen timeouts","Timeout for fullscreen timeouts"),
SPEC_IMAGE_TOLERANCE("galen.spec.image.tolerance",25,"Tolerance difference during image comparison","Tolerance difference during image comparison"),
SPEC_IMAGE_ERROR_RATE("galen.spec.image.error","0px","Image error rate","Image error rate"),
//@formatter:on
;
...
- Can be used to just list parameters via command line, the above enums can simply be listed via help ...
Lets discuss this one later. I am not sure about the real use for it at the moment.
on the java side it would be easier to use the enums, otherwise having all known config parameters at one place is nice.
Additonally by using enums we could use ConfigParameter.values()
to print out all config information also via commandline, e.g. when adding --help
as argument.
But anyway we can discuss this, it's just an idea
I propose to have a video call after the release of 1.5. Lets prepare a list of topics to discuss upfront and this one will also be there
@ishubin - I know this is an old thread. Still, it might be useful for someone.
I guess what @hypery2k mean is something like extending / overriding com.galenframework.config.GalenProperty (I know we cannot extend / override an enum class)
There are lots of properties used in GalenProperty enum , which is good. If we want to change any of them, it is possible. But if we want to add more properties, say my personal data which I can access anywhere in the context, which would be much easy.
@hypery2k - Here is a hack ! You can try the following.
GalenConfig.getConfig().getProperties().put("userName", "Deepak"); //You can use string or any object
GalenConfig.getConfig().getProperties().get("userName");
to add your data while in runtime and to get the same.