I have a test framework using Selenium WebDriver, cucumber-jvm, java. I have properties file with BASE_URL and other necessary so I can set everything properly in my IDE. But what about in command line?
How can I solve the parameterization of maven in case of different environment? I would like to use something like this in order to set the environment and tags in feature files.
mvn clean test -uat -@test
It would be important for me because I need to use teamcity to trigger these tests.
Thanks!
Here is the (self :))answer, Hope this helps for others.
You can create several profiles in pom.xml, set the id, properties and you can specify anything you want. in this case, base.url is set within the profile.
Add the following to the pom and you can reach this property with System.getproperty() method.
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemProperties>
<base.url>${base.url}</base.url>
</systemProperties>
</configuration>
</plugin>