0
I would like a tip on how to check if it is the correct Fragment after the click
Follow the thought (Wrong) for example, someone has an example of how I can test this?
@RunWith(AndroidJUnit4.class)
public class MapsActivityTest extends AppCompatActivity {
FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = fragmentManager.findFragmentByTag(getResources().getString(R.string.fragment_routes_title));
@Test
@SmallTest
public void showUIMap() {
onView(withId(R.id.request_textview)).perform(click()).check(assertThat(fragment.getActivity().getSupportFragmentManager()
.findFragmentByTag("MyRides)"),is(true));
}
}
Another question, I must extend the Appcompactivity?
Oops, thank you! But that’s not the reasoning. I want to know, if clicking will be the correct Fragment. I’m automating interface tests.
– Henrique