Hello all!
I am new to Robotium and i have a simple app:
1 ImageView
3 RadioButtons to change image in ImageView
I need to test that after click on radioButton, image changes to proper one:
public void testChangeColor() throws Exception{
RadioButton radioButton = (RadioButton)solo.getView(R.id.radioButton);
ImageView imageView = (ImageView)solo.getView(R.id.imageView);
Drawable drawable = ContextCompat.getDrawable(imageView.getContext(),R.mipmap.android_image);
solo.scrollToSide(Solo.RIGHT);
solo.waitForFragmentById(R.layout.fragment_main);
solo.clickOnView(radioButton);
Thread.sleep(1000);
Assert.assertEquals(imageView.getDrawable(), drawable);
}
Unfortunately this piece of code doesn't work. Any solutions? This should be very basic test though, but i couldn't find any tutorial or piece of knowledge.