Refactored the UI test cases according to this new change.

This commit is contained in:
MohitMaliFtechiz 2024-09-19 11:32:33 +05:30
parent 386a93699b
commit b3cff85921
3 changed files with 21 additions and 3 deletions

View File

@ -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()
}
}
}

View File

@ -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()
}
}
}

View File

@ -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()
}
}
}