本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例6: performItemSelected
import android.widget.Button; //导入方法依赖的package包/类
private void performItemSelected(Button button) {
button.performClick();
setSelectedState(button);
}