mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 06:42:21 -04:00
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:
parent
0278fa8a0c
commit
8770efd03d
@ -24,6 +24,7 @@ import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
|
|||||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers.withSubstring
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||||
import applyWithViewHierarchyPrinting
|
import applyWithViewHierarchyPrinting
|
||||||
import com.adevinta.android.barista.interaction.BaristaSleepInteractions
|
import com.adevinta.android.barista.interaction.BaristaSleepInteractions
|
||||||
@ -131,11 +132,7 @@ class DownloadRobot : BaseRobot() {
|
|||||||
fun assertDownloadPaused() {
|
fun assertDownloadPaused() {
|
||||||
testFlakyView({
|
testFlakyView({
|
||||||
pauseForBetterTestPerformance()
|
pauseForBetterTestPerformance()
|
||||||
onView(
|
onView(withSubstring(context.getString(string.paused_state))).check(matches(isDisplayed()))
|
||||||
withText(
|
|
||||||
org.kiwix.kiwixmobile.core.R.string.paused_state
|
|
||||||
)
|
|
||||||
).check(matches(isDisplayed()))
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user