/* * Wrapper method for mSolo.waitForCondition with additional logging. */ protected final boolean waitForCondition(Condition condition, int timeout) { boolean result = mSolo.waitForCondition(condition, timeout); if (!result) { // Log timeout failure for diagnostic purposes only; a failed wait may // be normal and does not necessarily warrant a test asssertion/failure. mAsserter.dumpLog("waitForCondition timeout after " + timeout + " ms."); } return result; }
public void verifyNewEnquiryFormPresence() { solo.waitForCondition( new Condition() { @Override public boolean isSatisfied() { Activity currentActivity = solo.getCurrentActivity(); View enquirerNameView = currentActivity.findViewById("enquirer_name".hashCode()); EditText enquirerNameEditText = (null == enquirerNameView ? null : (EditText) enquirerNameView.findViewById(R.id.value)); String enquirerNameText = (null == enquirerNameEditText ? null : enquirerNameEditText.getText().toString()); return (null != enquirerNameText) && ("".equals(enquirerNameText)); } }, 10000); solo.searchButton("Save"); }