diff --git a/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/params/SystemDialogsSafetyParams.kt b/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/params/SystemDialogsSafetyParams.kt index ea71857c7..6ba974678 100644 --- a/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/params/SystemDialogsSafetyParams.kt +++ b/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/params/SystemDialogsSafetyParams.kt @@ -2,12 +2,12 @@ package com.kaspersky.kaspresso.params data class SystemDialogsSafetyParams( val shouldIgnoreKeyboard: Boolean, - val shouldIgnorePermissionController: Boolean + val shouldIgnorePermissionDialogs: Boolean ) { companion object { fun default() = SystemDialogsSafetyParams( shouldIgnoreKeyboard = false, - shouldIgnorePermissionController = false + shouldIgnorePermissionDialogs = false ) } } diff --git a/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/systemsafety/SystemDialogSafetyProviderImpl.kt b/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/systemsafety/SystemDialogSafetyProviderImpl.kt index 19cd6fd9c..9805acc1e 100644 --- a/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/systemsafety/SystemDialogSafetyProviderImpl.kt +++ b/kaspresso/src/main/kotlin/com/kaspersky/kaspresso/systemsafety/SystemDialogSafetyProviderImpl.kt @@ -111,8 +111,9 @@ class SystemDialogSafetyProviderImpl( */ private fun isAndroidSystemDetected(): Boolean { with(uiDevice) { - var isSystemDialogVisible = if (systemDialogsSafetyParams.shouldIgnorePermissionController) { - SystemDialogSafetyPattern.values().filter { it != SystemDialogSafetyPattern.PERMISSION_API30 }.any { isVisible(By.pkg(it.pattern).clazz(FrameLayout::class.java)) } + var isSystemDialogVisible = if (systemDialogsSafetyParams.shouldIgnorePermissionDialogs) { + SystemDialogSafetyPattern.values().filter { it != SystemDialogSafetyPattern.PERMISSION_API30 && it != SystemDialogSafetyPattern.PERMISSION_API23} + .any { isVisible(By.pkg(it.pattern).clazz(FrameLayout::class.java)) } } else { SystemDialogSafetyPattern.values().any { isVisible(By.pkg(it.pattern).clazz(FrameLayout::class.java)) } }