QAF Version
2.1.13 and 2.1.14-RC1
I have below testdata in xml file -
<registration>
<existingdata>
<title>Mr</title>
<firstname>Narendra</firstname>
<lastname>Rajput</lastname>
<email>narendra.rajput@infostretch.com</email>
<password>Qwerty@123</password>
<confirmPassword>Qwerty@123</confirmPassword>
<message>${registration.existing.user.message}</message>
</existingdata>
</registration>
And the message's values is store in appdata.en_GB
file -
registration.existing.user.message = There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.
While I'm trying to access the message value in BDD step as given below -
Then verify user with same email already registered message '${registration.existingdata.message}'
Code implementation of the above step is -
@QAFTestStep(stepName = "verifyUserAlreadyRegisteredMessage", description = "verify user with same email already registered message {0}")
public void verifyUserAlreadyRegisteredMessage(String message) {
verifyVisible("message.success.failure.text");
verifyText("message.success.failure.text", message);
}
Expected behavior
Here I should be able to get the message value i.e. There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.
Actual behavior
But it is retrieving the values as - ${registration.existing.user.message} which is reference key in XML file
And this is how i have load the locales in application.properties
file :
env.default.locale=en_GB
env.load.locales=en_GB
Note : If i'm running the test by passing in key then its working as expected as shown below
SCENARIO: UserRegistrationWithExistingEmail
META-DATA: {"description":"Registration with already registered email","groups":["REGRESSION"],"key":"registration.existingdata"}
Given user is on homepage
When clicks on create an account link
And fill registration form with data '${args[0]}'
And click on register button
Then verify user with same email already registered message '${message}'
END