serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
180 stars 285 forks source link

@DefaultURL("page:url.from.config.file") no longer referencing the serenity.config file after upgrading serenity version to 3.6.21 #99

Open AvA0808 opened 1 year ago

AvA0808 commented 1 year ago

After upgrading my project to version 3.6.21 I receive this error when running.

java.lang.AssertionError: Invalid URL: page:signin.url
at net.serenitybdd.core.pages.PageUrls.verified(PageUrls.java:80)

It was working prior to the update and all of my syntax looks correct, I wonder if this feature changed or the syntax changed. After trying to google search around for some answers I have come here. 🙂

Page file

@DefaultUrl("page:signin.url")
public class SigninPage extends PageObject { 
   ... 
}

serenity.config file

environments {
  prod {   
    signin.url = "https://signin.com"   
  }
  dev {   
    signin.url = "https://dev-signin.com"   
  }
  default {   
    signin.url = "https://dev-signin.com"   
  }
  all {   
    admin.signin.url = "#{signin.url}/admin"   
  }
}

If I instead change the Page file to contain a static url, that works and I don't get an error. @DefaultUrl("https://dev-signin.com")

But, I need it to reference my serenity.config file instead because I pass in the environment when I run the serenity tests mvn clean verify -Denvironment=dev

recsat commented 4 days ago

I have this same issue but on 4.1.3, was there ever any feedback on this?

wakaleo commented 4 days ago

@recsat As this is an open source library, maintenance work (and status updates) are done mostly when requested by clients with commercial support contracts or by the interested parties themselves. Open source libraries are "free" as in you are free to contribute, not as in you are entitled to free support. If you are using Serenity BDD for your commercial projects and would benefit from quicker support and feedback, please feel free to consider the commercial support options: https://www.serenitydojo.academy/serenity-bdd-support-packages.

recsat commented 3 days ago

@wakaleo Thanks for your reply. Sure I understand that, i was just curious if the poster had received any feedback or pointers regarding the changes to this functionality as all the information i've been able to find on this no longer seems to work in the newer versions. Unfortunately the project I am working on would not be looking at commercial support options, so i'll just have to keep looking. I was originally using the information from your article here https://johnfergusonsmart.com/environment-specific-configuration-in-serenity-bdd/