serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
722 stars 518 forks source link

I want to use configuration from serenity.conf, instead in the build.gradle file (for serenity-bitbar integration). #3163

Open StephenBrainord opened 1 year ago

StephenBrainord commented 1 year ago

Hi Serenity Team,

I have a use case where we are using some configurations through serenity.conf in our serenity-gradle project. And I have below queries-

  1. Can we use the same configurations from the build.gradle file? As I want to eleminate the use of serenity.conf in the project. For example- my sereniy.conf has below configurations- webdriver { driver = remote capabilities { platformName = "Windows" browserName = "chrome" browserVersion = "latest" "bitbar:options" { osVersion = "10" screenResolution = "1920x1200" } } }

bitbar { active = true apiKey = "YOUR_API_KEY" hub = "eu-desktop-hub"
cloudUrl = "https://cloud.bitbar.com" }

I want the above to be declared through build.gradle file instead of serenity.conf. Let me know if something like that is possible.

  1. For serenity-bitbar integration, I see that serenity.conf are suggested to be used. Is there any way we can use the same bitbar configs in serenity.properties? If there is any implementation for serenity-bitbar using serenity.properties, it would help greatly.
wakaleo commented 1 year ago

You can use system properties for some of the Serenity properties, but the capabilities need to be in the serenity.conf file because they rely on the nested HOCON structure.

StephenBrainord commented 1 year ago

@wakaleo Thank you for the prompt response. Is there a way to use the same config in the build.gradle file. I have tried the above mentioned configs in the build.gradle as below-

project.serenity { configurations { webdriver { driver = remote capabilities { platformName = "Windows" browserName = "chrome" browserVersion = "latest" "bitbar:options" { osVersion = "10" screenResolution = "1920x1200" } } } bitbar { active = true apiKey = "YOUR_API_KEY" hub = "eu-desktop-hub" cloudUrl = "https://cloud.bitbar.com" } } }

But on using this we are seeing below error- could not set unknown property 'driver' for configuration ':webdriver' of type org.gradle.api.internal.artifacts.configurations.defaultconfiguration.

Any input on this could be useful. Thank you!

wakaleo commented 1 year ago

No, this is not supported.