I've never used espresso before. Now i want to auto type some text in editText field fragment. I know only how to do it with Activity.
@LargeTest
public class EspressoTest {
@Rule
public ActivityTestRule<CheckInActivity> mActivityRule =
new ActivityTestRule<>(CheckInActivity.class);
@Test
public void testActivityShouldHaveText() throws InterruptedException {
onView(withId(R.id.editText)).perform(clearText(), typeText("KI"));
}
}
I have MainFragment hosted by MainActivity and editText is placed inside MainFragment layout.
Also is there a way in espresso to click on some text, so it could find the view by text?