serenity-bdd / serenity-cucumber4-starter

48 stars 73 forks source link

[Question] How to use @DefaultUrl with environment variable #7

Closed newsn31 closed 5 years ago

newsn31 commented 5 years ago

I watched the YouTube video about environment configuration with serenity.conf https://www.youtube.com/watch?v=WP60WYwfgSQ

I was able to use the variable home.page as a default url. However when I try to concatenate it to a longer URL, it says the URL is not defined. Example:

In my serenity.conf: environments { default { webdriver.base.url = "https://www.iherbtest.com/" } test { webdriver.base.url = "https://www.iherbtest.com/" } prod { webdriver.base.url = "https://www.iherb.com/" } all { home.page = "#{webdriver.base.url}" } }

In my page object: @DefaultUrl("page:home.page/auth/Account/Register") public class RegisterAccountPage extends PageObject { public static By EMAIL_TEXTFIELD = By.id("Username"); }

Is there a way to do this?

Thanks

wakaleo commented 5 years ago

The “page:” format does not support variable substitution.