Java Code Examples for android.support.test.espresso.contrib.DrawerActions

The following are top voted examples for showing how to use android.support.test.espresso.contrib.DrawerActions. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Runnest   File: MessageTest.java   View source code 6 votes vote down vote up
@Test
public void challengeRequestAccept() {
    // Send message
    sendTestMessage(Message.Type.CHALLENGE_REQUEST, Challenge.Type.DISTANCE, true);

    //Tap on the request
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());

    //Tap on Accept
    tryIsDisplayed(withId(R.id.request_layout), UI_TEST_TIMEOUT);
    onView(withId(R.id.accept_btn)).perform(click());
    onView(isRoot()).perform(waitForMatch(withId(R.id.readyBtn), UI_TEST_TIMEOUT));

    //Delete challenges from firebase
    new FirebaseHelper().deleteChallengeNode("Runnest IHL vs Test User test1");
}
 
Example 2
Project: Runnest   File: MessageTest.java   View source code 6 votes vote down vote up
@Test
public void scheduleMessageCancelAndAccept() {
    // Send message
    sendTestMessage(Message.Type.SCHEDULE_REQUEST, Challenge.Type.DISTANCE, false);

    //Tap on the request
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));

    //Tap on Cancel
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
    tryIsDisplayed(withId(R.id.cancel_btn), UI_TEST_TIMEOUT);
    onView(withId(R.id.cancel_btn)).perform(click());

    //Tap on Accept
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
    tryIsDisplayed(withId(R.id.accept_btn), UI_TEST_TIMEOUT);
    onView(withId(R.id.accept_btn)).perform(click());
}
 
Example 3
Project: Runnest   File: MessageTest.java   View source code 6 votes vote down vote up
@Test
public void scheduleMessageDecline() {
    // Send message
    sendTestMessage(Message.Type.SCHEDULE_REQUEST, Challenge.Type.TIME, false);

    //Tap on the request
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));

    //Tap on Decline
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
    tryIsDisplayed(withId(R.id.decline_btn), UI_TEST_TIMEOUT);
    onView(withId(R.id.decline_btn)).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
}
 
Example 4
Project: Runnest   File: MessageTest.java   View source code 6 votes vote down vote up
@Test
public void memoMessageCloseDelete() {
    // Send message
    sendTestMessage(Message.Type.MEMO, Challenge.Type.TIME, false);

    //Tap on the request
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());

    //Tap on Close
    tryIsDisplayed(withId(R.id.cancel_btn), UI_TEST_TIMEOUT);
    onView(withId(R.id.cancel_btn)).perform(click());

    //Tap on Delete
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
    tryIsDisplayed(withId(R.id.decline_btn), UI_TEST_TIMEOUT);
    onView(withId(R.id.decline_btn)).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
}
 
Example 5
Project: Runnest   File: MessageTest.java   View source code 6 votes vote down vote up
@Test
public void memoMessageChallenge() {
    // Send message
    sendTestMessage(Message.Type.MEMO, Challenge.Type.DISTANCE, false);

    //Tap on the request
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));

    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());

    //Tap on Challenge
    tryIsDisplayed(withId(R.id.accept_btn), UI_TEST_TIMEOUT);
    onView(withId(R.id.accept_btn)).perform(click());

    tryIsDisplayed(withId(R.id.time_radio), UI_TEST_TIMEOUT);
}
 
Example 6
Project: Runnest   File: BackHandTest.java   View source code 6 votes vote down vote up
@Test
public void runFragmentLifecycleTest() {

    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));

    // Jenkins sleep (1/3)
    //
    // Sleep necessary in order to successfully build on Jenkins, I wasn't able to
    // reproduce the failure in local. After a lot of attempts I decided to keep it.
    SystemClock.sleep(FIREBASE_DURATION);

    onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));

    activityRule.getActivity().finish();
    activityRule.getActivity();
}
 
Example 7
Project: Runnest   File: RunTest.java   View source code 6 votes vote down vote up
@Test
public void startAndStopRun() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));

    // Jenkins sleep (1/3)
    //
    // Sleep necessary in order to successfully build on Jenkins, I wasn't able to
    // reproduce the failure in local. After a lot of attempts I decided to keep it.
    SystemClock.sleep(FIREBASE_DURATION);

    onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
    onView(withId(R.id.start_run)).perform(click());

    SystemClock.sleep(MOCK_LOCATION_DURATION);

    onView(isRoot()).perform(waitForMatch(withId(R.id.stop_run), UI_TEST_TIMEOUT));
    onView(withId(R.id.stop_run)).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.button_history), UI_TEST_TIMEOUT));
    onView(withId(R.id.button_history)).perform(click());
}
 
Example 8
Project: Runnest   File: AppNavigationTest.java   View source code 6 votes vote down vote up
@Test
public void navigateToLogout() {
    // Logout cancel
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_logout));
    tryIsDisplayed(withId(android.R.id.button2), UI_TEST_TIMEOUT);
    onView(withId(android.R.id.button2)).perform(click());

    // Logout ok
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_logout));
    tryIsDisplayed(withId(android.R.id.button2), UI_TEST_TIMEOUT);
    onView(withText("OK")).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.sign_in_button), UI_TEST_TIMEOUT));
}
 
Example 9
Project: delern   File: NavigationTest.java   View source code 6 votes vote down vote up
@Test
public void inviteWasNotSent() {
    Instrumentation.ActivityResult result = new Instrumentation
            .ActivityResult(Activity.RESULT_CANCELED, null);
    intending(toPackage("com.google.android.gms")).respondWith(result);
    waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
    onView(withId(R.id.nav_view))
            .perform(NavigationViewActions.navigateTo(R.id.nav_invite));
    intended(allOf(hasAction("com.google.android.gms.appinvite.ACTION_APP_INVITE"),
            toPackage("com.google.android.gms")));
    onView(withText(R.string.invitation_failed_message))
            .inRoot(withDecorView(not(mActivityRule.getActivity().getWindow().getDecorView())))
            .check(matches(isDisplayed()));
}
 
Example 10
Project: delern   File: NavigationTest.java   View source code 6 votes vote down vote up
@Test
public void inviteSent() {
    Instrumentation.ActivityResult result = new Instrumentation
            .ActivityResult(Activity.RESULT_OK, null);
    intending(toPackage("com.google.android.gms")).respondWith(result);
    waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
    onView(withId(R.id.nav_view))
            .perform(NavigationViewActions.navigateTo(R.id.nav_invite));
    intended(allOf(hasAction("com.google.android.gms.appinvite.ACTION_APP_INVITE"),
            toPackage("com.google.android.gms")));
    waitView(() -> onView(withText(R.string.invitation_sent_message))
            .inRoot(withDecorView(not(mActivityRule.getActivity().getWindow().getDecorView())))
            .check(matches(isDisplayed())));
}
 
Example 11
Project: delern   File: NavigationTest.java   View source code 6 votes vote down vote up
@Test
public void sendFeedbackEmailTest() {
    Context context = mActivityRule.getActivity().getBaseContext();
    intending(toPackage("android.intent.action.CHOOSER"));

    waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
    waitView(() -> onView(withId(R.id.nav_view))
            .perform(NavigationViewActions.navigateTo(R.id.nav_contact_us)));
    intended(allOf(
            hasAction("android.intent.action.CHOOSER"),
            hasExtra("android.intent.extra.TITLE", context.
                    getString(R.string.send_email_intent_chooser_message))));

}
 
Example 12
Project: Runnest   File: MessageTest.java   View source code 5 votes vote down vote up
@Test
public void challengeRequestCancelAndDecline() {
    // Send message
    sendTestMessage(Message.Type.CHALLENGE_REQUEST, Challenge.Type.TIME, true);

    //Tap on the request
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));

    //Tap on Cancel
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());

    SystemClock.sleep(FIREBASE_DURATION);

    tryIsDisplayed(withId(R.id.request_layout), UI_TEST_TIMEOUT);
    onView(withId(R.id.cancel_btn)).perform(click());

    //Tap on Decline
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
    tryIsDisplayed(withId(R.id.request_layout), UI_TEST_TIMEOUT);
    onView(withId(R.id.decline_btn)).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));

    //Delete challenges from firebase
    new FirebaseHelper().deleteChallengeNode("Runnest IHL vs Test User test1");
}
 
Example 13
Project: Runnest   File: MessageTest.java   View source code 5 votes vote down vote up
@Test
public void memoMessageBusyChallenge() {
    // Send message
    Message msg1 = new Message("busyEmail",
            "Test User",
            "busyUser",
            "Test User",
            Message.Type.MEMO,
            "test1",
            new Date(),
            1,
            0,
            Challenge.Type.DISTANCE);

    FirebaseHelper firebaseHelper = new FirebaseHelper();
    firebaseHelper.sendMessage(msg1);

    // Needed to be sure that the sent message appears on firebase
    SystemClock.sleep(FIREBASE_DURATION);

    //Tap on the request
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));

    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());

    //Tap on Challenge
    tryIsDisplayed(withId(R.id.accept_btn), UI_TEST_TIMEOUT);
    onView(withId(R.id.accept_btn)).perform(click());
}
 
Example 14
Project: Runnest   File: ChallengeTest.java   View source code 5 votes vote down vote up
@Test
public void displayChallenge() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));

    onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
    onView(allOf(withText("Challenges"), isDescendantOfA(withId(R.id.tabs)))).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
}
 
Example 15
Project: Runnest   File: RunTest.java   View source code 5 votes vote down vote up
@Test
public void startAndAbortRun() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));

    // Jenkins sleep (2/3)
    //
    // Sleep necessary in order to successfully build on Jenkins, I wasn't able to
    // reproduce the failure in local. After a lot of attempts I decided to keep it.
    SystemClock.sleep(FIREBASE_DURATION);

    onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
    onView(withId(R.id.start_run)).perform(click());

    SystemClock.sleep(MOCK_LOCATION_DURATION);

    //Press on CANCEL
    pressBack();
    tryIsDisplayed(withId(android.R.id.button2), UI_TEST_TIMEOUT);
    onView(withId(android.R.id.button2)).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.stop_run), UI_TEST_TIMEOUT));

    pressBack();
    tryIsDisplayed(withId(android.R.id.button1), UI_TEST_TIMEOUT);
    onView(withId(android.R.id.button1)).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.main_layout), UI_TEST_TIMEOUT));
}
 
Example 16
Project: Runnest   File: RunTest.java   View source code 5 votes vote down vote up
@Test
public void deleteRun() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));

    // Jenkins sleep (3/3)
    //
    // Sleep necessary in order to successfully build on Jenkins, I wasn't able to
    // reproduce the failure in local. After a lot of attempts I decided to keep it.
    SystemClock.sleep(FIREBASE_DURATION);

    onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
    onView(withId(R.id.start_run)).perform(click());

    SystemClock.sleep(MOCK_LOCATION_DURATION);

    onView(isRoot()).perform(waitForMatch(withId(R.id.stop_run), UI_TEST_TIMEOUT));
    onView(withId(R.id.stop_run)).perform(click());

    // Exit and enter displayChallenge
    tryIsDisplayed(withId(R.id.button_history), TIME_CHALLENGE_DURATION + UI_TEST_TIMEOUT);

    onView(withId(R.id.button_history)).perform(click());
    onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
    onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.button_delete), UI_TEST_TIMEOUT));
    onView(withId(R.id.button_delete)).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
}
 
Example 17
Project: Runnest   File: RunTest.java   View source code 5 votes vote down vote up
@Test
public void displayRun() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));

    onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
    onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());

    onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
    onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
}
 
Example 18
Project: Runnest   File: AppNavigationTest.java   View source code 5 votes vote down vote up
@Test
public void navigateToChallengeHistory() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));

    onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
    onView(allOf(withText("Challenges"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
}
 
Example 19
Project: Runnest   File: AppNavigationTest.java   View source code 5 votes vote down vote up
@Test
public void navigateToSingleRunHistory() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));

    onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
    onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
    onView(allOf(withText("Challenges"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
    onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
}
 
Example 20
Project: Runnest   File: AppNavigationTest.java   View source code 5 votes vote down vote up
@Test
public void backButtonWorks() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));
    onView(isRoot()).perform(waitForMatch(withId(R.id.start_run),  UI_TEST_TIMEOUT));

    Espresso.pressBack();
    onView(isRoot()).perform(waitForMatch(withId(R.id.main_layout),  UI_TEST_TIMEOUT));
}
 
Example 21
Project: delern   File: SharingTest.java   View source code 5 votes vote down vote up
private static void signOut() {
    waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
    waitView(() -> onView(withId(R.id.nav_view))
            .perform(NavigationViewActions.navigateTo(R.id.nav_sign_out)));
    onView(withText(R.string.sign_out)).check(matches(isDisplayed()));
    onView(withText(R.string.sign_out)).perform(click());
    waitView(() -> onView(withId(R.id.sign_in_button)).check(matches(isDisplayed())));
}
 
Example 22
Project: delern   File: NavigationTest.java   View source code 5 votes vote down vote up
@Test
public void openNavigationDrawer() {
    waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.close());
}
 
Example 23
Project: delern   File: NavigationTest.java   View source code 5 votes vote down vote up
@Test
public void signOut() {
    waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
    waitView(() -> onView(withId(R.id.nav_view))
            .perform(NavigationViewActions.navigateTo(R.id.nav_sign_out)));
    onView(withText(R.string.sign_out)).check(matches(isDisplayed()));
    onView(withText(R.string.sign_out)).perform(click());
}
 
Example 24
Project: delern   File: NavigationTest.java   View source code 5 votes vote down vote up
@Test
public void openAndCloseNavigationDrawerPressingBack() {
    waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
    // Close navigation drawer by pressing back.
    pressBack();
    waitView(() -> onView(withId(R.id.nav_view)).check(matches(not(isDisplayed()))));
}
 
Example 25
Project: aws-device-farm-sample-app-for-android   File: BaseADFTest.java   View source code 5 votes vote down vote up
/**
 * Gets the activity and navigates to the Class's category in the navigation drawer
 *
 * Uses espresso-contrib dor navigation drawer and recyclerView support
 *
 * @throws Exception instrumentation ActivityInstrumentationTestCase2 exception
 */
@Override
protected void setUp() throws Exception {
    getActivity(); //IMPORTANT you must call this before your tests!
    super.setUp();
    DrawerActions.openDrawer(R.id.drawer_layout);
    RecyclerViewActions.scrollTo(withText(getClassName()));
    onView(withId(R.id.drawerList)).perform(RecyclerViewActions.actionOnItem(hasDescendant(withText(getClassName())), click()));
    InstrumentationRegistry.getInstrumentation().waitForIdleSync();
}
 
Example 26
Project: Runnest   File: AppNavigationTest.java   View source code 4 votes vote down vote up
@Test
public void aDrawerLayout() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.drawer_layout)).check(matches(isOpen()));
}
 
Example 27
Project: Runnest   File: AppNavigationTest.java   View source code 4 votes vote down vote up
@Test
public void navigateToRunningMap() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));
}
 
Example 28
Project: Runnest   File: AppNavigationTest.java   View source code 4 votes vote down vote up
@Test
public void navigateToRunHistory() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));
}
 
Example 29
Project: Runnest   File: AppNavigationTest.java   View source code 4 votes vote down vote up
@Test
public void navigateToMessages() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
}
 
Example 30
Project: Runnest   File: AppNavigationTest.java   View source code 4 votes vote down vote up
@Test
public void navigateToProfile() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_profile));
}
 
Example 31
Project: Runnest   File: AppNavigationTest.java   View source code 4 votes vote down vote up
@Test
public void navigateToNewChallenge() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_new_challenge));
    onView(isRoot()).perform(waitForMatch(withId(R.id.empty_layout),  UI_TEST_TIMEOUT));
}
 
Example 32
Project: Runnest   File: AppNavigationTest.java   View source code 4 votes vote down vote up
@Test
public void backButtonCloseDrawer() {
    onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
    Espresso.pressBack();
    onView(isRoot()).perform(waitForMatch(withId(R.id.main_layout),  UI_TEST_TIMEOUT));
}
 
Example 33
Project: Android   File: Achievements_InstrumentationTest.java   View source code 4 votes vote down vote up
private void openDrawer()
{
   onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
}
 
Example 34
Project: Android   File: Achievements_InstrumentationTest.java   View source code 4 votes vote down vote up
private void closeDrawer(){
   onView(withId(R.id.drawer_layout)).perform(DrawerActions.close());
}
 
Example 35
Project: Android   File: LoginFlow_InstrumentationTest.java   View source code 4 votes vote down vote up
private void openDrawer()
{
   onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
}
 
Example 36
Project: Android   File: LoginFlow_InstrumentationTest.java   View source code 4 votes vote down vote up
private void closeDrawer(){
   onView(withId(R.id.drawer_layout)).perform(DrawerActions.close());
}
 
Example 37
Project: Android   File: ApplicationTest.java   View source code 4 votes vote down vote up
private void openDrawer()
{
 onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
}
 
Example 38
Project: Android   File: ApplicationTest.java   View source code 4 votes vote down vote up
private void closeDrawer(){
 onView(withId(R.id.drawer_layout)).perform(DrawerActions.close());
}
 
Example 39
Project: Android   File: TrailMap_InstrumentationTest.java   View source code 4 votes vote down vote up
private void openDrawer()
{
   onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
}
 
Example 40
Project: Android   File: TrailMap_InstrumentationTest.java   View source code 4 votes vote down vote up
private void closeDrawer(){
   onView(withId(R.id.drawer_layout)).perform(DrawerActions.close());
}