-
- All Implemented Interfaces:
-
com.kaspersky.components.kautomator.screen.UiScreenActions
public abstract class UiScreen<T extends UiScreen<T>> implements UiScreenActions
Container class for UiAutomator elements.
This class groups UI elements and grants access to basic actions, such as pressBack
-
-
Field Summary
Fields Modifier and Type Field Description private final StringpackageNameprivate final UiDeviceInteractionDelegateview
-
Constructor Summary
Constructors Constructor Description UiScreen()
-
Method Summary
Modifier and Type Method Description final Unitintercept(Function1<UiInterceptor.Configurator, Unit> configurator)Sets the interceptors for the screen. final Unitreset()Removes the interceptors from the screen. final Unitinvoke(Function1<T, Unit> function)Operator that allows usage of DSL style abstract StringgetPackageName()UiDeviceInteractionDelegategetView()-
Methods inherited from class com.kaspersky.components.kautomator.screen.UiScreen
pressBack, waitForWindowUpdate, waitForWindowUpdate -
Methods inherited from class com.kaspersky.components.kautomator.screen.UiScreenActions
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
intercept
final Unit intercept(Function1<UiInterceptor.Configurator, Unit> configurator)
Sets the interceptors for the screen. Interceptors will be invoked on all interactions while the screen is active.
The screen is considered
activewhen it is invoked in one of the following ways:val screen = SomeScreen() screen { // Active view { click() } ... } // InactiveIf you use nesting screens, all interceptors of the screens that became active will be invoked in LIFO order (using Deque).
- Parameters:
configurator- Configuration of the interceptors
-
invoke
final Unit invoke(Function1<T, Unit> function)
Operator that allows usage of DSL style
- Parameters:
function- Tail lambda with receiver which is your screen
-
getPackageName
abstract String getPackageName()
-
getView
UiDeviceInteractionDelegate getView()
-
-
-
-