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

  1. UAT
  2. QA

Let us create folder structure to store locale content across these two environments

  1. Create a folder locale_data under src/test/resources/. A root folder holding content for different locale.

  2. 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 environment
    • locale_data/UAT: Folder to hold locale data for UAT environment

  3. 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 present
  • locale: Target locale for localisation testing
  • locale.env: Folder name under locale.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