mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -04:00
Improved the background download test.
This commit is contained in:
parent
16ea02274b
commit
f99e37a017
@ -242,6 +242,7 @@ class DownloadTest : BaseActivityTest() {
|
||||
|
||||
@Test
|
||||
fun downloadZIMFileInBackground() {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
|
||||
activityScenario.onActivity {
|
||||
kiwixMainActivity = it
|
||||
it.navigate(KiwixDestination.Library.route)
|
||||
@ -281,7 +282,15 @@ class DownloadTest : BaseActivityTest() {
|
||||
refreshList(composeTestRule)
|
||||
waitUntilZimFilesRefreshing(composeTestRule)
|
||||
downloadRobot {
|
||||
runCatching {
|
||||
checkIfZimFileDownloaded(composeTestRule)
|
||||
}.onFailure {
|
||||
// if currently downloading check.
|
||||
clickDownloadOnBottomNav(composeTestRule)
|
||||
waitForDataToLoad(composeTestRule = composeTestRule)
|
||||
stopDownloadIfAlreadyStarted(composeTestRule)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user