-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISSUE-678: Dialogs safety refactoring
- Loading branch information
Showing
2 changed files
with
79 additions
and
21 deletions.
There are no files selected for viewing
20 changes: 19 additions & 1 deletion
20
kaspresso/src/main/kotlin/com/kaspersky/kaspresso/params/SystemDialogsSafetyParams.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
package com.kaspersky.kaspresso.params | ||
|
||
import java.util.concurrent.TimeUnit | ||
|
||
/** | ||
* @param shouldIgnoreKeyboard by default kaspresso treats the keyboard as a system dialog. Enabling this flag prevents a keyboard closing | ||
* @param shouldIgnoreCrashes whether kaspresso should check if there's a system crash dialog. Be aware that enabling it increases a time spent | ||
* on a dialog detection about `waitTimeout` * 2 | ||
* @param shouldIgnorePermissionDialogs whether kaspresso should try to automagically close the permission dialogs | ||
* @param waitTimeout the time spent on a try to detect each of a single type of a dialog | ||
* | ||
* @see com.kaspersky.kaspresso.systemsafety.SystemDialogSafetyProviderImpl.isAndroidSystemDetected | ||
* @see com.kaspersky.kaspresso.systemsafety.SystemDialogSafetyPattern | ||
*/ | ||
data class SystemDialogsSafetyParams( | ||
val shouldIgnoreKeyboard: Boolean, | ||
val shouldIgnoreCrashes: Boolean, | ||
val waitTimeout: Long = TimeUnit.SECONDS.toMillis(1), | ||
val shouldIgnorePermissionDialogs: Boolean, | ||
) { | ||
companion object { | ||
fun default() = SystemDialogsSafetyParams(shouldIgnoreKeyboard = false, shouldIgnoreCrashes = false) | ||
fun default() = SystemDialogsSafetyParams( | ||
shouldIgnoreKeyboard = false, | ||
shouldIgnoreCrashes = true, | ||
shouldIgnorePermissionDialogs = false | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters