当前位置: 首页>>代码示例>>Java>>正文


Java Button.performClick方法代码示例

本文整理汇总了Java中android.widget.Button.performClick方法的典型用法代码示例。如果您正苦于以下问题:Java Button.performClick方法的具体用法?Java Button.performClick怎么用?Java Button.performClick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.Button的用法示例。


在下文中一共展示了Button.performClick方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testChangePassword_blankCurrentPassword

import android.widget.Button; //导入方法依赖的package包/类
@Test
public void testChangePassword_blankCurrentPassword() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("");
    mEtNewPassword.setText("QWERTY");
    mEtConfirmNewPassword.setText("QWERTY");

    TextView label = (TextView) activity.findViewById(R.id.textViewChangePassCurrPassMessage);
    Assert.assertFalse("current password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("current password lable is not been set",label.getText().length()>1);
}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:17,代码来源:ChangePasswordActivityTest.java

示例2: testChangePassword_blankNewPassword

import android.widget.Button; //导入方法依赖的package包/类
@Test
public void testChangePassword_blankNewPassword() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("QWERTY");
    mEtNewPassword.setText("");
    mEtConfirmNewPassword.setText("QWERTY");

    TextView label = (TextView) activity.findViewById(R.id.textViewChangePassNewPassMessage);
    Assert.assertFalse("new password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("new password lable is not been set",label.getText().length()>1);
}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:17,代码来源:ChangePasswordActivityTest.java

示例3: testChangePassword_blankConfirmPassword

import android.widget.Button; //导入方法依赖的package包/类
@Test
public void testChangePassword_blankConfirmPassword() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("QWERTY");
    mEtNewPassword.setText("QWERTY");
    mEtConfirmNewPassword.setText("");

    TextView label = (TextView) activity.findViewById(R.id.textViewConfirmPassNewPassMessage);
    Assert.assertFalse("confirm password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("confirm password lable is not been set",label.getText().length()>1);
}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:17,代码来源:ChangePasswordActivityTest.java

示例4: testChangePassword_password_does_not_match

import android.widget.Button; //导入方法依赖的package包/类
@Test
public void testChangePassword_password_does_not_match() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("QWERTY");
    mEtNewPassword.setText("QWERTY");
    mEtConfirmNewPassword.setText("QWERTY1");

    TextView label = (TextView) activity.findViewById(R.id.textViewConfirmPassNewPassMessage);
    Assert.assertFalse("confirm password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("confirm password lable is not been set",label.getText().length()>1);
}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:17,代码来源:ChangePasswordActivityTest.java

示例5: locateDepartment

import android.widget.Button; //导入方法依赖的package包/类
public void locateDepartment(long departmentId) {
    logger.d("department#locateDepartment id:%s", departmentId);

    if (topContactTitle == null) {
        logger.e("department#TopTabButton is null");
        return;
    }
    Button tabDepartmentBtn = topContactTitle.getTabDepartmentBtn();
    if (tabDepartmentBtn == null) {
        return;
    }
    tabDepartmentBtn.performClick();
    locateDepartmentImpl(departmentId);
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:15,代码来源:ContactFragment.java

示例6: performItemSelected

import android.widget.Button; //导入方法依赖的package包/类
private void performItemSelected(Button button) {
    button.performClick();
    setSelectedState(button);
}
 
开发者ID:parkingwang,项目名称:vehicle-keyboard-android,代码行数:5,代码来源:InputView.java


注:本文中的android.widget.Button.performClick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。