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
I am not sure about that but we can retrieve the color of some of elements like button and text views `
Button button = (Button) findViewById(R.id.my_button);
Drawable buttonBackground = button.getBackground();
and you can try like this
ColorDrawable b_color = (ColorDrawable) button.getBackground();
and then
int color = b_color.getColor();
if (color == R.color.green) {
log("color is green");
}
Hope this will get you started.