Calabash - iOS模拟器无法选择键盘语言

4
我在Calabash测试方面是个新手,在尝试制作多语言应用时遇到了一个障碍。以下是我的测试场景: - 我选择一个文本字段。 - 输入一种语言的字符串,然后输入另一种语言的一些文本。
问题出在这里:当我试图通过测试来切换语言时 - 它失败了。我的意思是,应用程序尝试查找下一个语言的符号,并因为当前键盘布局不含该符号而无限循环。
我目前唯一找到的解决方案是手动切换布局,但实际上并不适合真正的测试。
我应该如何解决这个问题?
1个回答

0

有两个步骤:

  1. 使用Calabash命令行工具更改模拟器的语言和区域设置。
  2. 使用参数启动应用程序以设置首选语言和区域设置。

完整的参考资料可以在Calabash iOS维基页面上找到:更改语言和区域设置

# 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)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接