I create tests using Selenium WebDriver and Cucumber-jvm, built on Maven. I want to achieve next:
I want to have profiles with properties and use this properties in my steps depended on enviroments.
I've created a folder in src/test/resources
and added 2 subfolder in it: Staging
and Dev
.
In each folder I have a file config.properties
where I have saved username
.
My POM looks like :
<profiles>
<profile>
<id>staging</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
</properties>
</profile>
</profiles>
Now I want to change properties of profiles to something like this:
<properties> test/resources/dev/config.properties</properties>
<properties> test/resources/staging/config.properties</properties>
And I want when I run my test with an active staging profile in my step defs when I call:
system.getProperty("username")
I want this to return username
which is provided in staging's properties.
When I run this when dev
profile is active, I want to get dev
's property.