Package 

Class UiScreen

  • 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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      UiScreen()
    • Method Summary

      Modifier and Type Method Description
      final Unit intercept(Function1<UiInterceptor.Configurator, Unit> configurator) Sets the interceptors for the screen.
      final Unit reset() Removes the interceptors from the screen.
      final Unit invoke(Function1<T, Unit> function) Operator that allows usage of DSL style
      abstract String getPackageName()
      UiDeviceInteractionDelegate getView()
      • 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
    • Constructor Detail

      • UiScreen

        UiScreen()
    • 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 active when it is invoked in one of the following ways:

        val screen = SomeScreen()
        
        screen { // Active
            view { click() }
            ...
        } // Inactive

        If 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
      • reset

         final Unit reset()

        Removes the interceptors from the screen.

      • 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