我是Calabash测试的新手,在尝试制作多语言应用时遇到了障碍.
这是我的测试场景:
– 我选择了一个文本字段.
– 输入一种语言的字符串,然后输入另一种语言.
这是我的测试场景:
– 我选择了一个文本字段.
– 输入一种语言的字符串,然后输入另一种语言.
这里出现了障碍:当我尝试通过测试切换语言时 – 它失败了.我的意思是应用程序试图找到下一种语言的符号并无休止地循环,因为当前的键盘布局不包含它.
我发现的唯一解决方案是手动切换布局,但这不是实际测试的选项.
我该怎么办呢?
解决方法
有两个步骤:
>使用Calabash命令行工具更改模拟器的语言和区域设置.
>使用参数启动应用程序以设置首选语言和区域设置.
完整的参考资料可以在这个Calabash iOS维基页面上找到: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)