Skip to content

Instantly share code, notes, and snippets.

@alouanemed
Created March 17, 2018 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alouanemed/eb78247f98842eec19769540fb2cad18 to your computer and use it in GitHub Desktop.
Save alouanemed/eb78247f98842eec19769540fb2cad18 to your computer and use it in GitHub Desktop.
@Test
fun clickOnAndroidHomeIcon_OpensNavigationAndLogOut() {
// Check that left drawer is closed at startup
onView(withId(R.id.drawer_layout))
.check(matches(isClosed(Gravity.LEFT)))
// Open Drawer
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
// Check if drawer is open
onView(withId(R.id.drawer_layout))
.check(matches(isOpen(Gravity.LEFT)))
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_log_out))
}
@Test
fun testInitViews() {
onView(withId(R.id.fab)).check(matches(not(isDisplayed())))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment