Improved the DownloadTest to handle cases where pausing the download may show a complete pause message, such as 'Pause: Waiting for Retry,' which previously caused the test case to fail. The test case has been updated to accommodate this behavior.

This commit is contained in:
MohitMaliFtechiz 2024-09-13 17:48:31 +05:30
parent 0278fa8a0c
commit 8770efd03d

View File

@ -24,6 +24,7 @@ import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withSubstring
import androidx.test.espresso.matcher.ViewMatchers.withText
import applyWithViewHierarchyPrinting
import com.adevinta.android.barista.interaction.BaristaSleepInteractions
@ -131,11 +132,7 @@ class DownloadRobot : BaseRobot() {
fun assertDownloadPaused() {
testFlakyView({
pauseForBetterTestPerformance()
onView(
withText(
org.kiwix.kiwixmobile.core.R.string.paused_state
)
).check(matches(isDisplayed()))
onView(withSubstring(context.getString(string.paused_state))).check(matches(isDisplayed()))
})
}