Extend unit tests
This commit is contained in:
parent
37b49b1e38
commit
cbff160bd5
@ -59,7 +59,7 @@ public class ShareDialogTest {
|
|||||||
onDrawerItem(withText(R.string.episodes_label)).perform(click());
|
onDrawerItem(withText(R.string.episodes_label)).perform(click());
|
||||||
|
|
||||||
Matcher<View> allEpisodesMatcher;
|
Matcher<View> allEpisodesMatcher;
|
||||||
allEpisodesMatcher = Matchers.allOf(withId(android.R.id.list), isDisplayed(), hasMinimumChildCount(2));
|
allEpisodesMatcher = Matchers.allOf(withId(R.id.recyclerView), isDisplayed(), hasMinimumChildCount(2));
|
||||||
onView(isRoot()).perform(waitForView(allEpisodesMatcher, 1000));
|
onView(isRoot()).perform(waitForView(allEpisodesMatcher, 1000));
|
||||||
onView(allEpisodesMatcher).perform(actionOnItemAtPosition(0, click()));
|
onView(allEpisodesMatcher).perform(actionOnItemAtPosition(0, click()));
|
||||||
onView(first(EspressoTestUtils.actionBarOverflow())).perform(click());
|
onView(first(EspressoTestUtils.actionBarOverflow())).perform(click());
|
||||||
|
@ -81,12 +81,24 @@ public class NavigationDrawerTest {
|
|||||||
UserPreferences.setHiddenDrawerItems(new ArrayList<>());
|
UserPreferences.setHiddenDrawerItems(new ArrayList<>());
|
||||||
activityRule.launchActivity(new Intent());
|
activityRule.launchActivity(new Intent());
|
||||||
|
|
||||||
|
// home
|
||||||
|
openNavDrawer();
|
||||||
|
onDrawerItem(withText(R.string.home_label)).perform(click());
|
||||||
|
onView(isRoot()).perform(waitForView(allOf(isDescendantOfA(withId(R.id.toolbar)),
|
||||||
|
withText(R.string.home_label)), 1000));
|
||||||
|
|
||||||
// queue
|
// queue
|
||||||
openNavDrawer();
|
openNavDrawer();
|
||||||
onDrawerItem(withText(R.string.queue_label)).perform(click());
|
onDrawerItem(withText(R.string.queue_label)).perform(click());
|
||||||
onView(isRoot()).perform(waitForView(allOf(isDescendantOfA(withId(R.id.toolbar)),
|
onView(isRoot()).perform(waitForView(allOf(isDescendantOfA(withId(R.id.toolbar)),
|
||||||
withText(R.string.queue_label)), 1000));
|
withText(R.string.queue_label)), 1000));
|
||||||
|
|
||||||
|
// Inbox
|
||||||
|
openNavDrawer();
|
||||||
|
onDrawerItem(withText(R.string.inbox_label)).perform(click());
|
||||||
|
onView(isRoot()).perform(waitForView(allOf(isDescendantOfA(withId(R.id.toolbar)),
|
||||||
|
withText(R.string.inbox_label)), 1000));
|
||||||
|
|
||||||
// episodes
|
// episodes
|
||||||
openNavDrawer();
|
openNavDrawer();
|
||||||
onDrawerItem(withText(R.string.episodes_label)).perform(click());
|
onDrawerItem(withText(R.string.episodes_label)).perform(click());
|
||||||
@ -143,6 +155,7 @@ public class NavigationDrawerTest {
|
|||||||
openNavDrawer();
|
openNavDrawer();
|
||||||
onDrawerItem(withText(R.string.queue_label)).perform(longClick());
|
onDrawerItem(withText(R.string.queue_label)).perform(longClick());
|
||||||
onView(withText(R.string.episodes_label)).perform(click());
|
onView(withText(R.string.episodes_label)).perform(click());
|
||||||
|
onView(withId(R.id.contentPanel)).perform(swipeUp());
|
||||||
onView(withText(R.string.playback_history_label)).perform(click());
|
onView(withText(R.string.playback_history_label)).perform(click());
|
||||||
onView(withText(R.string.confirm_label)).perform(click());
|
onView(withText(R.string.confirm_label)).perform(click());
|
||||||
|
|
||||||
@ -160,8 +173,9 @@ public class NavigationDrawerTest {
|
|||||||
openNavDrawer();
|
openNavDrawer();
|
||||||
onView(first(withText(R.string.queue_label))).perform(longClick());
|
onView(first(withText(R.string.queue_label))).perform(longClick());
|
||||||
|
|
||||||
onView(withText(R.string.downloads_label)).perform(click());
|
|
||||||
onView(withText(R.string.queue_label)).perform(click());
|
onView(withText(R.string.queue_label)).perform(click());
|
||||||
|
onView(withId(R.id.contentPanel)).perform(swipeUp());
|
||||||
|
onView(withText(R.string.downloads_label)).perform(click());
|
||||||
onView(withText(R.string.confirm_label)).perform(click());
|
onView(withText(R.string.confirm_label)).perform(click());
|
||||||
|
|
||||||
hidden = UserPreferences.getHiddenDrawerItems();
|
hidden = UserPreferences.getHiddenDrawerItems();
|
||||||
@ -184,7 +198,7 @@ public class NavigationDrawerTest {
|
|||||||
onView(allOf(withText(title), isDisplayed())).perform(click());
|
onView(allOf(withText(title), isDisplayed())).perform(click());
|
||||||
|
|
||||||
if (i == 3) {
|
if (i == 3) {
|
||||||
onView(withId(R.id.select_dialog_listview)).perform(swipeUp());
|
onView(withId(R.id.contentPanel)).perform(swipeUp());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,6 +220,7 @@ public class NavigationDrawerTest {
|
|||||||
openNavDrawer();
|
openNavDrawer();
|
||||||
|
|
||||||
onView(first(withText(R.string.queue_label))).perform(longClick());
|
onView(first(withText(R.string.queue_label))).perform(longClick());
|
||||||
|
onView(withId(R.id.contentPanel)).perform(swipeUp());
|
||||||
onView(first(withText(R.string.downloads_label))).perform(click());
|
onView(first(withText(R.string.downloads_label))).perform(click());
|
||||||
onView(withText(R.string.confirm_label)).perform(click());
|
onView(withText(R.string.confirm_label)).perform(click());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user