4

I’m novice at Calabash testing and faced an obstacle while trying to make a multi-language app. Here is my test scenario: - I select a textfield. - Enter a string with one language and then enter some text with another.

And here occurs the obstacle: when I try to switch the language through the tests - it fails. I mean the application tries to find a symbol for the next language and loops endlessly because current keyboard layout doesn’t contain it.

The only solution I found yet is to switch a layout manually but thats not an option actually for real testing.

How could I fix it?

Vladimir
  • 41
  • 1

1 Answers1

0

There are two steps:

  1. Use Calabash command line tools to change the language and locale of the simulator.
  2. Launch the app with arguments to set the preferred language and locale.

The complete reference can be found on this Calabash iOS wiki page: Change Locale and Language

# Set the simulator language to Swiss German and locale to Swiss French
$ calabash-ios sim locale de-CH fr_CH

# In your Before hook, tell Calabash to launch the app in the locale and language.
options = {

# Launch with Swiss German as the primary language and Swiss French as the locale.
:args => ["-AppleLanguages", "(de-CH)",
          "-AppleLocale", "fr_CH"]

}

launcher.relaunch(options)
jmoody
  • 2,480
  • 1
  • 16
  • 22