@Before public void setUp() throws Exception { MyActivity activity = new MyActivity(); activity.onCreate( null ); ImageView image = (ImageView) activity.findViewById( R.id.sun_earth_image ); Button button = (Button) activity.findViewById( R.id.next_screen_button ); } @Test public void shouldHaveHiddenButton() throws Exception { assertViewIsHidden( button ); } @Test public void shouldShowButtonAfterImageClick() throws Exception { image.performClick(); assertViewIsVisible( button ); }