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
|
customMainActivity = it
|
||||||
}
|
}
|
||||||
// test with a large ZIM file to properly test the scenario
|
// test with a large ZIM file to properly test the scenario
|
||||||
downloadingZimFile = getDownloadingZimFile()
|
downloadingZimFile = getDownloadingZimFileFromDataFolder()
|
||||||
getOkkHttpClientForTesting().newCall(downloadRequest()).execute().use { response ->
|
getOkkHttpClientForTesting().newCall(downloadRequest()).execute().use { response ->
|
||||||
if (response.isSuccessful) {
|
if (response.isSuccessful) {
|
||||||
response.body?.let { responseBody ->
|
response.body?.let { responseBody ->
|
||||||
@ -147,7 +147,7 @@ class SearchFragmentTestForCustomApp {
|
|||||||
UiThreadStatement.runOnUiThread {
|
UiThreadStatement.runOnUiThread {
|
||||||
customMainActivity.navigate(customMainActivity.readerFragmentResId)
|
customMainActivity.navigate(customMainActivity.readerFragmentResId)
|
||||||
}
|
}
|
||||||
openZimFileInReaderWithAssetFileDescriptor(downloadingZimFile)
|
openZimFileInReader(zimFile = downloadingZimFile)
|
||||||
openSearchWithQuery()
|
openSearchWithQuery()
|
||||||
val searchTerm = "gard"
|
val searchTerm = "gard"
|
||||||
val searchedItem = "Gardanta Spirito"
|
val searchedItem = "Gardanta Spirito"
|
||||||
|
@ -100,14 +100,16 @@ class SearchRobot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun searchAndClickOnArticle(searchString: String) {
|
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())
|
BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS_FOR_SEARCH_TEST.toLong())
|
||||||
openSearchScreen()
|
openSearchScreen()
|
||||||
|
// Wait a bit to properly visible the search screen.
|
||||||
|
BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS_FOR_SEARCH_TEST.toLong())
|
||||||
searchWithFrequentlyTypedWords(searchString)
|
searchWithFrequentlyTypedWords(searchString)
|
||||||
clickOnSearchItemInSearchList()
|
clickOnSearchItemInSearchList()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clickOnSearchItemInSearchList() {
|
private fun clickOnSearchItemInSearchList() {
|
||||||
testFlakyView({
|
testFlakyView({
|
||||||
BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS_FOR_SEARCH_TEST.toLong())
|
BaristaSleepInteractions.sleep(TestUtils.TEST_PAUSE_MS_FOR_SEARCH_TEST.toLong())
|
||||||
Espresso.onView(ViewMatchers.withId(R.id.search_list)).perform(
|
Espresso.onView(ViewMatchers.withId(R.id.search_list)).perform(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user