Compare commits

..

1 Commits

Author SHA1 Message Date
b5817865e4 ci: Instrumentation tests coverage in ci.
Some checks failed
Check PR code / EspressoReports (pull_request) Failing after 53m12s
2025-03-18 10:37:15 +01:00

View File

@ -21,7 +21,7 @@ import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiSelector
import org.hamcrest.CoreMatchers.allOf
import org.hamcrest.Matchers.hasToString
import org.junit.BeforeClass
import org.junit.Before
import java.util.Locale
fun performLogin(someUrl: String? = null) {
@ -128,7 +128,6 @@ fun testAddSourceWithUrl(
}
open class WithANRException {
companion object {
// Running count of the number of Android Not Responding dialogues to prevent endless dismissal.
private var anrCount = 0
@ -142,15 +141,7 @@ open class WithANRException {
"Root:",
)
private fun handleAnrDialogue() {
val device = UiDevice.getInstance(getInstrumentation())
// If running the device in English Locale
val waitButton = device.findObject(UiSelector().textContains("wait"))
if (waitButton.exists()) waitButton.click()
}
@JvmStatic
@BeforeClass
@Before
fun setUpHandler() {
Espresso.setFailureHandler { error, viewMatcher ->
@ -162,5 +153,11 @@ open class WithANRException {
}
}
}
private fun handleAnrDialogue() {
val device = UiDevice.getInstance(getInstrumentation())
// If running the device in English Locale
val waitButton = device.findObject(UiSelector().textContains("wait"))
if (waitButton.exists()) waitButton.click()
}
}