mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Fixed: The SearchFragmentTestForCustomApp
was failing sometimes.
This commit is contained in:
parent
499ea74048
commit
a9364d5881
@ -131,7 +131,7 @@ class SearchFragmentTestForCustomApp {
|
||||
customMainActivity = it
|
||||
}
|
||||
// test with a large ZIM file to properly test the scenario
|
||||
downloadingZimFile = getDownloadingZimFile()
|
||||
downloadingZimFile = getDownloadingZimFileFromDataFolder()
|
||||
getOkkHttpClientForTesting().newCall(downloadRequest()).execute().use { response ->
|
||||
if (response.isSuccessful) {
|
||||
response.body?.let { responseBody ->
|
||||
@ -147,7 +147,7 @@ class SearchFragmentTestForCustomApp {
|
||||
UiThreadStatement.runOnUiThread {
|
||||
customMainActivity.navigate(customMainActivity.readerFragmentResId)
|
||||
}
|
||||
openZimFileInReaderWithAssetFileDescriptor(downloadingZimFile)
|
||||
openZimFileInReader(zimFile = downloadingZimFile)
|
||||
openSearchWithQuery()
|
||||
val searchTerm = "gard"
|
||||
val searchedItem = "Gardanta Spirito"
|
||||
|
@ -100,14 +100,16 @@ class SearchRobot {
|
||||
}
|
||||
|
||||
fun searchAndClickOnArticle(searchString: String) {
|
||||
// wait a bit to properly load the ZIM file in the reader
|
||||
// Wait a bit to properly load the ZIM file in the reader.
|
||||
BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS_FOR_SEARCH_TEST.toLong())
|
||||
openSearchScreen()
|
||||
// Wait a bit to properly visible the search screen.
|
||||
BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS_FOR_SEARCH_TEST.toLong())
|
||||
searchWithFrequentlyTypedWords(searchString)
|
||||
clickOnSearchItemInSearchList()
|
||||
}
|
||||
|
||||
fun clickOnSearchItemInSearchList() {
|
||||
private fun clickOnSearchItemInSearchList() {
|
||||
testFlakyView({
|
||||
BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS_FOR_SEARCH_TEST.toLong())
|
||||
Espresso.onView(ViewMatchers.withId(R.id.search_list)).perform(
|
||||
|
Loading…
x
Reference in New Issue
Block a user