Is it possible to check if the background color matches a given color with espresso?
Update:
I made a custom matcher, similar to what @Irfa
Another approach to check TextView text's color could be via hasTextColor(int color)
as it comes directly from Espresso.
import static android.support.test.espresso.matcher.ViewMatchers.hasTextColor;
onView(withId(R.id.anyTextView)).check(matches(hasTextColor(R.color.red)));
Be aware that this method is currently in Beta for Espresso 3.0.1