galen icon indicating copy to clipboard operation
galen copied to clipboard

Improve Galen config handling

Open hypery2k opened this issue 10 years ago • 4 comments

  • 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 ...

hypery2k avatar Jan 17 '15 16:01 hypery2k

Lets discuss this one later. I am not sure about the real use for it at the moment.

ishubin avatar Jan 18 '15 20:01 ishubin

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

hypery2k avatar Jan 20 '15 11:01 hypery2k

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 avatar Jan 20 '15 12:01 ishubin

@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.

pingdpk avatar Jun 12 '18 06:06 pingdpk