Localization Testing - Test Environments
Localization testing for different environments
Just like Test Data could be managed for various environments, locale content could also be managed across different environments.
Please refer Test Data Management docs to understand more on managing test data across different test environments
Define environment specific folders
As an example, let us assume we have 2 environments
- UAT
- QA
Let us create folder structure to store locale content across these two environments
Create a folder
locale_data
undersrc/test/resources/
. A root folder holding content for different locale.Create folder structure for these environments. Let us create the below folders under data_sets
locale_data/QA
: Folder to hold locale data for QA environmentlocale_data/UAT
: Folder to hold locale data for UAT environment
Add
confirmation_messages.json
files to have locale data.
Please refer Localization Testing for creating locale data and Model
Config changes to execute tests on a specific environment
locale.dir
: Root folder under which locale content is presentlocale
: Target locale for localisation testinglocale.env
: Folder name underlocale.dir
having locale data for specific environment eg: UAT | PREPROD | QA
Add below configurations to default.properties
or you could choose to create a separate config file.
# Folder name under resources having locale data
locale.dir: locale_data
# Locale for runtime
locale: en
# Folder name under resources having locale data for specific environment eg: UAT | PREPROD | QA
locale.env: UAT
Execute the test !
Execute test for differenr environment
For instance, to execute tests against QA
change locale.env
to QA
in default.properties
.
# Folder name under resources having locale data
locale.dir: locale_data
# Locale for runtime
locale: id
# Folder name under resources having locale data for specific environment eg: UAT | PREPROD | QA
locale.env: QA
Execute the test. This time the order confirmation messages are served for QA
Please note You could chose to create different config file specific to targeted locale