Skip to content

Commit

Permalink
ISSUE-678: Close crash dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikitae57 committed Oct 14, 2024
1 parent e1b4e4d commit 711ec52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.kaspersky.kaspresso.params

data class SystemDialogsSafetyParams(
val shouldIgnoreKeyboard: Boolean
val shouldIgnoreKeyboard: Boolean,
val shouldIgnoreCrashes: Boolean,
) {
companion object {
fun default() = SystemDialogsSafetyParams(shouldIgnoreKeyboard = false)
fun default() = SystemDialogsSafetyParams(shouldIgnoreKeyboard = false, shouldIgnoreCrashes = false)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ class SystemDialogSafetyProviderImpl(
isSystemDialogVisible = isSystemDialogVisible && !isKeyboardVisible
}

if (!systemDialogsSafetyParams.shouldIgnoreCrashes) {
isSystemDialogVisible = isSystemDialogVisible || listOf("aerr_close", "aerr_close_app").any { isVisible(By.res("android", it)) }
}

if (isSystemDialogVisible) {
logger.i("The android system dialog/window was detected")
return true
Expand Down

0 comments on commit 711ec52

Please sign in to comment.