Class UiTestUtils

java.lang.Object
io.jmix.flowui.testassist.UiTestUtils

public final class UiTestUtils extends Object
Class provides helper methods for testing.
  • Method Details

    • getCurrentView

      public static <T extends View<?>> T getCurrentView()
      Returns instance of currently navigated view. Usage example:
       @Test
       public void navigateToUserListView() {
           viewNavigators.view(UserListView.class)
                   .navigate();
      
           UserListView view = UiTestUtils.getCurrentView();
       }
       
      Type Parameters:
      T - type of navigated view
      Returns:
      instance of currently navigated view
    • getComponent

      public static <T> T getComponent(View<?> view, String componentId)
      Returns a component defined in the view by the component id.
      Throws:
      IllegalArgumentException - if not found
    • validateView

      public static ValidationErrors validateView(StandardDetailView<?> view)
      Validates provided View by calling StandardDetailView#validateView() method from it.
      Parameters:
      view - detail view to validate
      Returns:
      errors if validation failed, otherwise empty object will be returned