mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Fixes:#4073 Old UI tests related with nav menu and user icon are deleted. (#4213)
This commit is contained in:
parent
2695bbaf4b
commit
a8bbd416da
3 changed files with 0 additions and 69 deletions
|
|
@ -29,7 +29,6 @@ class AchievementsActivityTest {
|
||||||
@Test
|
@Test
|
||||||
fun testAchievements() {
|
fun testAchievements() {
|
||||||
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
|
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
|
||||||
onView(withId(R.id.user_icon)).perform(click())
|
|
||||||
|
|
||||||
Intents.intended(hasComponent(ProfileActivity::class.java.name))
|
Intents.intended(hasComponent(ProfileActivity::class.java.name))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ class LeaderboardActivityTest {
|
||||||
@Test
|
@Test
|
||||||
fun testScrollToRankFromAbove() {
|
fun testScrollToRankFromAbove() {
|
||||||
Espresso.onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
|
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(ViewActions.click())
|
||||||
Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(selectTabAtPosition(1))
|
Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(selectTabAtPosition(1))
|
||||||
|
|
@ -58,7 +57,6 @@ class LeaderboardActivityTest {
|
||||||
@Test
|
@Test
|
||||||
fun testScrollToRankFromBelow() {
|
fun testScrollToRankFromBelow() {
|
||||||
Espresso.onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
|
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(ViewActions.click())
|
||||||
Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(selectTabAtPosition(1))
|
Espresso.onView(ViewMatchers.withId(R.id.tab_layout)).perform(selectTabAtPosition(1))
|
||||||
|
|
|
||||||
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue