diff --git a/app/src/androidTest/java/fr/free/nrw/commons/AchievementsActivityTest.kt b/app/src/androidTest/java/fr/free/nrw/commons/AchievementsActivityTest.kt index 6bded4351..16c27dd77 100644 --- a/app/src/androidTest/java/fr/free/nrw/commons/AchievementsActivityTest.kt +++ b/app/src/androidTest/java/fr/free/nrw/commons/AchievementsActivityTest.kt @@ -29,7 +29,6 @@ class AchievementsActivityTest { @Test fun testAchievements() { onView(withId(R.id.drawer_layout)).perform(DrawerActions.open()) - onView(withId(R.id.user_icon)).perform(click()) Intents.intended(hasComponent(ProfileActivity::class.java.name)) } diff --git a/app/src/androidTest/java/fr/free/nrw/commons/LeaderboardActivityTest.kt b/app/src/androidTest/java/fr/free/nrw/commons/LeaderboardActivityTest.kt index 7f613fea0..5b6a2c255 100644 --- a/app/src/androidTest/java/fr/free/nrw/commons/LeaderboardActivityTest.kt +++ b/app/src/androidTest/java/fr/free/nrw/commons/LeaderboardActivityTest.kt @@ -45,7 +45,6 @@ class LeaderboardActivityTest { @Test fun testScrollToRankFromAbove() { Espresso.onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open()) - Espresso.onView(ViewMatchers.withId(R.id.user_icon)).perform(ViewActions.click()) Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(ViewActions.click()) Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(selectTabAtPosition(1)) @@ -58,7 +57,6 @@ class LeaderboardActivityTest { @Test fun testScrollToRankFromBelow() { Espresso.onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open()) - Espresso.onView(ViewMatchers.withId(R.id.user_icon)).perform(ViewActions.click()) Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(ViewActions.click()) Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(selectTabAtPosition(1)) diff --git a/app/src/androidTest/java/fr/free/nrw/commons/NavigationBaseActivityTest.kt b/app/src/androidTest/java/fr/free/nrw/commons/NavigationBaseActivityTest.kt deleted file mode 100644 index f78142c9f..000000000 --- a/app/src/androidTest/java/fr/free/nrw/commons/NavigationBaseActivityTest.kt +++ /dev/null @@ -1,66 +0,0 @@ -package fr.free.nrw.commons - -import androidx.test.espresso.Espresso -import androidx.test.espresso.Espresso.onView -import androidx.test.espresso.contrib.DrawerActions -import androidx.test.espresso.contrib.NavigationViewActions -import androidx.test.espresso.matcher.ViewMatchers.withId -import androidx.test.filters.LargeTest -import androidx.test.rule.ActivityTestRule -import androidx.test.runner.AndroidJUnit4 -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -@LargeTest -@RunWith(AndroidJUnit4::class) -class NavigationBaseActivityTest { - @get:Rule - var activityRule: ActivityTestRule<*> = ActivityTestRule(AboutActivity::class.java) - - /** - * Goes through all the activities in the app and checks we don't crash - * NB: This is not realistic if we're not logged in; we can access 'home', 'notifications', 'settings' and 'achievements' which we wouldn't otherwise be able to. - */ - @Test - fun goThroughNavigationBaseActivityActivities() { - // Home - openNavigationDrawerAndNavigateTo(R.id.action_home) - - // Explore - openNavigationDrawerAndNavigateTo(R.id.action_explore) - - // Bookmarks - openNavigationDrawerAndNavigateTo(R.id.action_bookmarks) - - // Reviews - openNavigationDrawerAndNavigateTo(R.id.action_review) - - // Settings - openNavigationDrawerAndNavigateTo(R.id.action_settings) - - // About - openNavigationDrawerAndNavigateTo(R.id.action_about) - - // Tutorial - openNavigationDrawerAndNavigateTo(R.id.action_introduction) - Espresso.pressBack() - - // Achievements - openNavigationDrawerAndNavigateTo(R.id.action_login) - - // Feedback - openNavigationDrawerAndNavigateTo(R.id.action_feedback) - } - - private fun openNavigationDrawerAndNavigateTo(menuItemId: Int) { - onView(withId(R.id.drawer_layout)).perform(DrawerActions.open()) - UITestHelper.sleep(500) - onView(withId(R.id.navigation_view)).perform(NavigationViewActions.navigateTo(menuItemId)) - } - - @Test - fun orientationChange() { - UITestHelper.changeOrientation(activityRule) - } -} \ No newline at end of file