kyrax kyrax - 1 month ago 43x
Android Question

Android Espresso - Click checkbox if not checked

I have

, but i only want to do this if the check box is not already checked. How can I do this in espresso?


This seems to be part of your test, that the checkbox needs to be checked. You can check this by onView(withId(; If this fails, your test will fail, which may be good in your case. Then, you can perform the click you want after this case matches. If this is not the situation you want, can you explain more on what you are trying to do in this Espresso Test?