Class CardLocator

java.lang.Object
com.vaadin.browserless.locator.Locator<Card,CardLocator>
com.vaadin.flow.component.card.CardLocator
All Implemented Interfaces:
Clickable<Card>, HasAriaLabelFilter<Card,CardLocator>, HasThemeFilter<Card,CardLocator>

@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor") public class CardLocator extends Locator<Card,CardLocator> implements Clickable<Card>, HasAriaLabelFilter<Card,CardLocator>, HasThemeFilter<Card,CardLocator>
Generated locator for Card, derived from CardTester. Filter steps are inherited from Locator; action methods delegate to a fresh tester around the resolved component, so behavioral changes belong on the tester, not here.
  • Constructor Details

    • CardLocator

      public CardLocator()
    • CardLocator

      public CardLocator(Card component)
  • Method Details

    • getComponent

      public Card getComponent()
      Description copied from interface: Clickable
      Gets the component being tested.
      Specified by:
      getComponent in interface Clickable<Card>
      Returns:
      the component under test
    • ensureComponentIsUsable

      public void ensureComponentIsUsable()
      Description copied from interface: Clickable
      Ensures the component is in a usable state before interaction.
      Specified by:
      ensureComponentIsUsable in interface Clickable<Card>
    • getTitleAsText

      public String getTitleAsText()
      Gets the title text shown on the card. Javadoc copied from CardTester.getTitleAsText().
      Returns:
      the title text, or an empty string if no textual title is set
      Throws:
      IllegalStateException - if the card is not visible to the user, or if a header component is set so the title is not shown
    • getTitle

      public Component getTitle()
      Gets the component used as the card's title. Javadoc copied from CardTester.getTitle().
      Returns:
      the title component, or null if the title is not a component
      Throws:
      IllegalStateException - if the card is not visible to the user, or if a header component is set so the title is not shown
    • getSubtitle

      public Component getSubtitle()
      Gets the component used as the card's subtitle. Javadoc copied from CardTester.getSubtitle().
      Returns:
      the subtitle component, or null if no subtitle is set
      Throws:
      IllegalStateException - if the card is not visible to the user, or if a header component is set so the subtitle is not shown
    • getSubtitleAsText

      public String getSubtitleAsText()
      Gets the subtitle text shown on the card.

      Card.setSubtitle(String) wraps the text in a

      invalid reference
      Span
      , so a subtitle set as text is reported here, and so is the text of a
      invalid reference
      Span
      set with Card.setSubtitle(Component) ? the card stores the two the same way and cannot tell them apart. A subtitle set as any other component is not text and reports null; use getSubtitle() to get the component itself.

      Note that this differs from getTitleAsText(), which reports an empty string rather than null when the card shows no textual title, because a card keeps its title text in a property of its own instead of in a component. Javadoc copied from CardTester.getSubtitleAsText().

      Returns:
      the subtitle text, or null if no subtitle is set or the subtitle is not a text subtitle
      Throws:
      IllegalStateException - if the card is not visible to the user, or if a header component is set so the subtitle is not shown
    • getHeader

      public Component getHeader()
      Gets the component used as the card's header. When set, the header is shown instead of the title and subtitle. Javadoc copied from CardTester.getHeader().
      Returns:
      the header component, or null if no header is set
      Throws:
      IllegalStateException - if the card is not visible to the user
    • getHeaderPrefix

      public Component getHeaderPrefix()
      Gets the component shown before the card's header content. Javadoc copied from CardTester.getHeaderPrefix().
      Returns:
      the header prefix component, or null if none is set
      Throws:
      IllegalStateException - if the card is not visible to the user
    • getHeaderSuffix

      public Component getHeaderSuffix()
      Gets the component shown after the card's header content. Javadoc copied from CardTester.getHeaderSuffix().
      Returns:
      the header suffix component, or null if none is set
      Throws:
      IllegalStateException - if the card is not visible to the user
    • getMedia

      public Component getMedia()
      Gets the component shown as the card's media. Javadoc copied from CardTester.getMedia().
      Returns:
      the media component, or null if none is set
      Throws:
      IllegalStateException - if the card is not visible to the user
    • getFooterComponents

      public List<Component> getFooterComponents()
      Gets the components shown in the card's footer, in the order they were added. Javadoc copied from CardTester.getFooterComponents().
      Returns:
      the footer components, empty if the footer is empty
      Throws:
      IllegalStateException - if the card is not visible to the user