Class MasterDetailLayoutTester<T extends MasterDetailLayout>

java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.masterdetaillayout.MasterDetailLayoutTester<T>
Type Parameters:
T - component type
All Implemented Interfaces:
Clickable<T>

public class MasterDetailLayoutTester<T extends MasterDetailLayout> extends ComponentTester<T>
Tester for MasterDetailLayout components.

Provides access to the state of the layout as a user would observe it: the component shown in the master area, the component shown in the detail area, and the detail placeholder that is displayed when no detail content is set.

  • Constructor Details

    • MasterDetailLayoutTester

      public MasterDetailLayoutTester(T component)
      Wrap given component for testing.
      Parameters:
      component - target component
  • Method Details

    • getMaster

      @Nullable public @Nullable Component getMaster()
      Gets the component currently shown in the master area.
      Returns:
      the component in the master area, or null if there is no component in the master area
      Throws:
      IllegalStateException - if the layout is not visible to the user
    • getDetail

      @Nullable public @Nullable Component getDetail()
      Gets the component currently shown in the detail area.
      Returns:
      the component in the detail area, or null if no detail content is set
      Throws:
      IllegalStateException - if the layout is not visible to the user
    • getDetailPlaceholder

      @Nullable public @Nullable Component getDetailPlaceholder()
      Gets the placeholder component currently shown in the detail area. The placeholder is only shown to the user while no detail content is set.
      Returns:
      the placeholder component shown in the detail area, or null if no placeholder is set
      Throws:
      IllegalStateException - if the layout is not visible to the user, or if detail content is set so the placeholder is not shown
    • isDetailPlaceholderVisible

      public boolean isDetailPlaceholderVisible()
      Checks whether the detail placeholder is currently shown to the user. A placeholder is shown when one is set and there is no detail content.
      Returns:
      true if the placeholder is shown, false otherwise
      Throws:
      IllegalStateException - if the layout is not visible to the user