Class TextTester

  • All Implemented Interfaces:
    com.vaadin.browserless.Clickable

    
    public class TextTester<T extends Text>
    extends ComponentTester<T>
                        

    Tester for Text components.

    Text renders as a text node rather than an HTML element, so it has no visibility or enabled state of its own (isVisible throws, and a text node cannot be disabled). Usability is therefore derived from the component being attached and from the effective visibility of its parent subtree.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final T component
    • Constructor Summary

      Constructors 
      Constructor Description
      TextTester(T component) Wrap given component for testing.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getText() Gets the text of the component.
      boolean isUsable() Validate that component can be interacted with and should be visible in the UI.
      • Methods inherited from class com.vaadin.browserless.ComponentTester

        ensureComponentIsUsable, find, getComponent, setModal
      • Methods inherited from class com.vaadin.browserless.Clickable

        click, click, click, middleClick, middleClick, rightClick, rightClick
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextTester

        TextTester(T component)

        Wrap given component for testing.

        Parameters:
        component - target component
    • Method Detail

      • getText

         String getText()

        Gets the text of the component.

        Returns:

        the text, never null

      • isUsable

         boolean isUsable()

        Validate that component can be interacted with and should be visible in the UI. Subclasses overriding this method should also override notUsableReasons to provide additional details to the potential exception thrown by ensureComponentIsUsable.

        Returns:

        true if component can be interacted with by the user