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 6cf3c49d1..c1c1e5234 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt @@ -77,7 +77,13 @@ class DownloadRobot : BaseRobot() { onView(withText(string.swipe_down_for_library)).check(matches(isDisplayed())) refreshOnlineList() } catch (e: RuntimeException) { - // do nothing as the view is not visible + try { + // do nothing as currently downloading the online library. + onView(withId(R.id.onlineLibraryProgressLayout)).check(matches(isDisplayed())) + } catch (e: RuntimeException) { + // if not visible try to get the online library. + refreshOnlineList() + } } } diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt index 44c6bb7bc..4f75865a3 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt @@ -86,7 +86,13 @@ class InitialDownloadRobot : BaseRobot() { onView(withText(string.swipe_down_for_library)).check(matches(isDisplayed())) refreshOnlineList() } catch (e: RuntimeException) { - // do nothing as the view is not visible + try { + // do nothing as currently downloading the online library. + onView(withId(R.id.onlineLibraryProgressLayout)).check(matches(isDisplayed())) + } catch (e: RuntimeException) { + // if not visible try to get the online library. + refreshOnlineList() + } } } diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/language/LanguageRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/language/LanguageRobot.kt index 881db6866..87756eebe 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/language/LanguageRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/language/LanguageRobot.kt @@ -68,7 +68,13 @@ class LanguageRobot : BaseRobot() { onView(ViewMatchers.withText(string.swipe_down_for_library)).check(matches(isDisplayed())) refreshOnlineList() } catch (e: RuntimeException) { - // do nothing as the view is not visible + try { + // do nothing as currently downloading the online library. + onView(withId(R.id.onlineLibraryProgressLayout)).check(matches(isDisplayed())) + } catch (e: RuntimeException) { + // if not visible try to get the online library. + refreshOnlineList() + } } }