void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
onView withId(R.id.login_email) \
perform typeText('correct@email.com')
onView withId(R.id.login_password) \
perform typeText('aaa')
onView withId(R.id.login_submit) \
perform click()
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
login('correct@email.com', 'aaa')
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
login('correct@email.com', 'aaa')
onView withId(R.id.login_error_message) \
check matches(withText('Password too short.'))
}
void testShouldShowPasswordTooShort() {
login('correct@email.com', 'aaa')
checkLoginErrorMessage('Password too short.')
}
void testShouldShowPasswordTooShort() {
login('correct@email.com', 'aaa')
checkLoginErrorMessage('Password too short.')
}
void testShouldShowPasswordTooShort() {
login('correct@email.com', 'aaa')
checkLoginErrorMessage('Password too short.')
}
static void login(String email, String password) {
typeText(R.id.login_email, email)
typeText(R.id.login_password, password)
click(R.id.login_submit)
}
static void login(String email, String password) {
typeText(R.id.login_email, email)
typeText(R.id.login_password, password)
click(R.id.login_submit)
}
static void typeText(@IdRes int id, String text) {
onView withId(id) perform typeText(text)
}
void testShouldShowPasswordTooShort() {
login('correct@email.com', 'aaa')
checkLoginErrorMessage('Password too short.')
}
subscription = service.byLocation(q, lat, lon)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this.&showDocs, this.&handleError)
final class ResultsActivity extends BaseActivity {
@Inject
protected SearchService service
private Subscription subscription
// ...
}
@Provides
SearchService provideSearchService() {
return { String q, double lat, double lon ->
// ...
return Observable.just(list)
} as SearchService
}
interface LocationService {
Observable<Location> getCurrentLocation()
}
@Provides
LocationService provideLocationService() {
return {
return just(createLocation(51.75, 19.45))
} as LocationService
}
final class LoginActivity extends BaseActivity {
@Inject
protected FacebookLoginButtonProvider provider
// ...
}
interface FacebookLoginButtonProvider {
void addToContainer(ViewGroup container,
SuccessCallback successCallback,
ErrorCallback errorCallback)
// ...
}
def button = new Button(container.context) button.id = R.id.facebook_login_button button.onClickListener = { successCallback.onSuccess("facebook_token") } container.addView(button)
def button = new Button(container.context) button.id = R.id.facebook_login_button button.onClickListener = { errorCallback.onError(new RuntimeException()) } container.addView(button)
@Override
protected void tearDown() throws Exception {
super.tearDown()
pressBackSeveralTimes()
}
private static void pressBackSeveralTimes() {
try {
6.times { pressBack() }
} catch (NoActivityResumedException ignore) {
}
}
static Matcher<View> hasImage(@DrawableRes int id) {
return new TypeSafeMatcher<ImageView>() {
@Override
boolean matchesSafely(ImageView imageView) {
// ...
return state == drawable.constantState
}
// ...
}
}
onSearchItemWithDoctor("Doctor House", R.id.search_doctor_calendar, ) check matches(isDisplayed())
onView(allOf(
isDescendantOfA(allOf(
withParent(withId(R.id.search_list)),
hasDescendant(allOf(
withId(R.id.search_doctor_name),
withText("Doctor House"))
)
)),
withId(R.id.search_doctor_calendar))
) check matches(isDisplayed())