Skip to content

Instantly share code, notes, and snippets.

@denyszet
Created March 3, 2015 14:37
Show Gist options
  • Save denyszet/58ec684ca7626dae87e0 to your computer and use it in GitHub Desktop.
Save denyszet/58ec684ca7626dae87e0 to your computer and use it in GitHub Desktop.
Espresso matcher for matching the EditText color.
public static Matcher<View> withTextColor(final int color) {
Checks.checkNotNull(color);
return new BoundedMatcher<View, EditText>(EditText.class) {
@Override
public boolean matchesSafely(EditText warning) {
return color == warning.getCurrentTextColor();
}
@Override
public void describeTo(Description description) {
description.appendText("with text color: ");
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment