android - Calabash Cucumber 字符串国际化 (R.string.*) 和使用 ID

标签 android testing internationalization cucumber calabash

我想使用 calabash/cucumber 来测试我的 android 应用程序,我想知道为什么我找不到有关如何在场景中使用国际化字符串的信息。

Android 将 R.string.* 与一个或多个 xml 文件和 ID 一起使用,以识别正确的 View 。

是否可以在 Calabash 中使用类似的东西?

Given I see R.string.hello_world

Given i enter R.string.hello_world into inout field with id R.id.input_1

最佳答案

我相信您正在寻找的功能没有实现。但是,calabash 通过以下宏支持国际化:

Then /^I press text of translated l10key (\d+)$/ 

Then /^I press button of translated l10key (\d+)$/

Then /^I press menu item of translated l10key (\d+)$/

Then /^I press toggle button of translated l10key (\d+)$/ 

Then /^I wait for the translated "([^\"]*)" l10nkey to appear$/ 

更多详情 here

关于android - Calabash Cucumber 字符串国际化 (R.string.*) 和使用 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20884746/

相关文章:

android - 如何在运行时更改图像?

java - 必须声明为抽象或实现抽象方法

android - 尝试使用 Intent 启动新的 Activity

c - HPUX 上的 wcwidth 问题 : Internationalization and Localization Issue on HPUX

android - 谷歌日历邀请电子邮件中的 URL 深度链接不起作用

javascript - 检查 TestCafe 测试中的值

java - Salesforce:调用方法并将联系人与 apex 测试方法的帐户相关联?

latex - Latex 中的多语言文档

ruby-on-rails - 确定名称以 `s` 、 `x` 或 `z` 结尾的最短方法,然后使用 `I18n.t` 方法

testing - Jasmine .toHaveBeenCalledWith(aDate) 不工作