本文整理匯總了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);
}