【问题标题】:Calabash Android: Is it possible to use wildcards in `query`?Calabash Android:是否可以在“查询”中使用通配符?
【发布时间】:2014-06-18 19:18:56
【问题描述】:

有没有办法使用通配符,例如* 在葫芦里 query?

例如query("TextView text:'My name is' * ")

【问题讨论】:

    标签: android cucumber automated-tests android-testing calabash


    【解决方案1】:

    您可以使用LIKE根据Xamarin docs进行通配符搜索

    e.g., "label {text LIKE 'C*ll'}"
    

    您也可以使用CONTAINS,例如

      query("TextView {text CONTAINS '(sn'}")
    

    ENDSWITHBEGINSWITH

       query("TextView {text BEGINSWITH 'R'}")
    

    【讨论】:

    • 不是根据这个 android 链接 blog.appthwack.com/… 说“通配符查询,如查询 '*' 有助于查看屏幕上的内容以及在使用控制台时如何访问它。”
    • 另见krazyrobot.com/2014/04/… 了解不同类型查询的示例
    • 我已经能够使用text CONTAINStext LIKEid LIKE 使用部分查询匹配,但我似乎无法使用contentDescription LIKE 生成任何查询结果。
    • 这是我看到的错误:Embed is a Cucumber method and is not available in this console.
    • 你的想法? contentDescription 根本不支持吗?
    猜你喜欢
    • 2020-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-20
    • 2010-10-31
    相关资源
    最近更新 更多