zoukankan      html  css  js  c++  java
  • 老李分享:robotium常用API 2

    断言:

    具体请查看官网

    断言方法assert(robotium特有的断言方式,实际项目中和Junit的assert方法配合使用)

    void assertCurrentActivity (String message, Class activityClass [,booleanisNewInstance])

    断言当前的activity是否是预期的

    参数:message-如果运行失败打印的消息activityClass-预期的activityisNewInstance-可选项,实际activity是否是预期activity的继承,如果为true则只要是继承关系就通过,false则必须是当前activity
    void assertCurrentActivity (String message, String name [,booleanisNewInstance])

    断言当前的activity是否是预期的

    参数:name-预期activity的名字

    void assertMemoryNotLow()

    断言目前系统可用内存是否过低,内存空间足够则通过

    is方法

    boolean isCheckBoxChecked (intindex | String text)

    判断checkBox是否处于被选中的状态,可以通过index和text两种方法定位

    参数:index-检查的checkBox的索引值,如果只有一个可用则为0;text-检查的checkBox的文字,可使用正则表达式.类似的有:

    boolean isRadioButtonChecked(int index | String text)

    boolean isToggleButtonChecked(int index | String text)

    boolean isSpinnerTextSelected ( [intindex, ]  String text)

    boolean isTextChecked (Stringtext)

    search方法

    boolean searchButton (Stringtext [, int minimumNumberOfMatches, boolean onlyVisible])判断当前的屏幕中是否能找到指定的button

    参数:text-查找的button的文字minimumNumberOfMatches-最小指定多少才算是通过,0表示1个或者多个onlyVisible-只记录可见的

    boolean searchText (String text[, int minimumNumberOfMatches, boolean scroll, boolean onlyVisible])判断当前的屏幕中是否能找到指定的text,即文本

    参数:text-查找的Text的文字minimumNumberOfMatches-最小指定多少才算是通过,0表示1个或者多个scroll-是否允许滚动搜索,true表示支持,false表示只能在当前屏幕内查找onlyVisible-只记录可见的

    boolean searchToggleButton(String text [, int minimumNumberOfMatches])

    boolean searchEditText (Stringtext)判断当前的屏幕中是否能找到指定的EditText

  • 相关阅读:
    python文本处理
    转 Deep Learning for NLP 文章列举
    backpropagation
    开发者必备的6款源码搜索引擎 转
    转【面向代码】学习 Deep Learning(二)Deep Belief Nets(DBNs)
    Sampling
    各种形式的熵函数,KL距离
    [转] 如何在ie11里使用a连接创建动态下载文件流
    修改chrome背景色
    [转] 使用 Spring 5 的 WebFlux 开发反应式 Web 应用
  • 原文地址:https://www.cnblogs.com/poptest/p/5121909.html
Copyright © 2011-2022 走看看