diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt index 2790fcaeb..5b2931604 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt @@ -19,11 +19,9 @@ package org.kiwix.kiwixmobile.download import android.util.Log -import androidx.recyclerview.widget.RecyclerView.ViewHolder import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.doesNotExist -import androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import applyWithViewHierarchyPrinting @@ -42,7 +40,7 @@ class DownloadRobot : BaseRobot() { private var retryCountForDataToLoad = 5 private var retryCountForCheckDownloadStart = 5 - private val zimFileTitle = "A little question a day" + private val zimFileTitle = "Off the Grid" fun clickLibraryOnBottomNav() { clickOn(ViewId(R.id.libraryFragment)) @@ -68,7 +66,7 @@ class DownloadRobot : BaseRobot() { fun waitForDataToLoad() { try { - isVisible(Text("Off the Grid")) + isVisible(Text(zimFileTitle)) } catch (e: RuntimeException) { if (retryCountForDataToLoad > 0) { retryCountForDataToLoad-- @@ -77,10 +75,6 @@ class DownloadRobot : BaseRobot() { } } - fun scrollToAlpineWikiZim() { - onView(withId(R.id.libraryList)).perform(scrollToPosition(20)) - } - fun checkIfZimFileDownloaded() { isVisible(Text(zimFileTitle)) } diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadTest.kt index b89ac32cc..208f28b60 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadTest.kt @@ -73,17 +73,17 @@ class DownloadTest : BaseActivityTest() { deleteZimIfExists() clickDownloadOnBottomNav() waitForDataToLoad() - scrollToAlpineWikiZim() downloadZimFile() assertDownloadStart() waitUntilDownloadComplete() clickLibraryOnBottomNav() checkIfZimFileDownloaded() + deleteZimIfExists() } } catch (e: Exception) { Assert.fail( """ - Couldn't find downloaded file 'A little question a day' + Couldn't find downloaded file 'Off the Grid' Original Exception: ${e.localizedMessage} """.trimIndent()