-
public final class UiInterceptor<Interaction extends Object, Assertion extends Object, Action extends Object>Base class for intercepting the call chain from Kautomator to UiAutomator.
Interceptors can be provided through KautomatorConfigurator runtime, different com.kaspersky.components.kautomator.component.screen.UiScreen as well as UiViews.
Interceptors are stacked during the runtime for any UiAutomator_DSL-UiAutomator
checkandperformoperations. The stack ordering is following: UiView interceptor -> UiScreen interceptors -> UiAutomatorDsl interceptor.Any of the interceptors in the chain can break the chain call by setting
isOverrideto true in onCheck, onPerform or onAll interception functions during the configuration. Doing this will not only prevent underlying interceptors from being invoked, but prevents UiAutomator from executing the operation. In that case, responsibility for actually making UiAutomator call lies on developer.For each operation the interceptor invocation cycle will be as follows:
// For check operation onAll?.invoke() onCheck?.invoke() // For perform operation onAll?.invoke() onPerform?.invoke()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBuilderBuilder class that is used to build a single instance of UiInterceptor.
public final classConfiguratorConfiguration class that is used for building interceptors on the KautomatorConfigurator runtime and com.kaspersky.components.kautomator.component.screen.UiScreen levels.
public final classConfiguration
-
Field Summary
Fields Modifier and Type Field Description private final UiInterception<Function2<Interaction, Assertion, Unit>>onCheckprivate final UiInterception<Function2<Interaction, Action, Unit>>onPerformprivate final UiInterception<Function1<Interaction, Unit>>onAll
-
Constructor Summary
Constructors Constructor Description UiInterceptor(UiInterception<Function2<Interaction, Assertion, Unit>> onCheck, UiInterception<Function2<Interaction, Action, Unit>> onPerform, UiInterception<Function1<Interaction, Unit>> onAll)
-
Method Summary
Modifier and Type Method Description final UiInterception<Function2<Interaction, Assertion, Unit>>getOnCheck()final UiInterception<Function2<Interaction, Action, Unit>>getOnPerform()final UiInterception<Function1<Interaction, Unit>>getOnAll()-
-
Constructor Detail
-
UiInterceptor
UiInterceptor(UiInterception<Function2<Interaction, Assertion, Unit>> onCheck, UiInterception<Function2<Interaction, Action, Unit>> onPerform, UiInterception<Function1<Interaction, Unit>> onAll)
-
-
Method Detail
-
getOnCheck
final UiInterception<Function2<Interaction, Assertion, Unit>> getOnCheck()
-
getOnPerform
final UiInterception<Function2<Interaction, Action, Unit>> getOnPerform()
-
getOnAll
final UiInterception<Function1<Interaction, Unit>> getOnAll()
-
-
-
-