Compare commits

..

1 Commits

Author SHA1 Message Date
bf395a6804 ci: Instrumentation tests coverage in ci.
All checks were successful
Check PR code / BuildAndTestAndCoverage (pull_request) Successful in 30m30s
2025-03-22 13:08:07 +01:00
2 changed files with 7 additions and 1 deletions

View File

@ -42,6 +42,8 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
cores: 6
script: |
./gradlew androidApp:createScreenshotDirectory
./gradlew JacocoDebugCodeCoverage || true

View File

@ -153,6 +153,7 @@ open class WithANRException {
"default root matcher, it may be picking a root that never takes focus. " +
"Root:",
)
private val otherException = "System Ul isn't responding"
private fun handleAnrDialogue() {
val device = UiDevice.getInstance(getInstrumentation())
@ -167,7 +168,10 @@ open class WithANRException {
Espresso.setFailureHandler { error, viewMatcher ->
takeScreenshot()
if (error.message!!.contains(rootViewWithoutFocusExceptionMsg) && anrCount < 3) {
if (error.message!!.contains(rootViewWithoutFocusExceptionMsg) &&
error.message!!.contains(otherException) &&
anrCount < 3
) {
anrCount++
handleAnrDialogue()
} else { // chain all failures down to the default espresso handler